VS10调试器表示无法在Silverlight应用程序中找到数据源列 [英] The VS10 debugger says it cannot find the datasource column in Silverlight application

查看:129
本文介绍了VS10调试器表示无法在Silverlight应用程序中找到数据源列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Windows.Data Error: BindingExpression path error: 'secUserName' property not found on 'DevExpress.Xpf.Grid.EditGridCellData' 'DevExpress.Xpf.Grid.EditGridCellData' (HashCode=2852273). BindingExpression: Path='secUserName' DataItem='DevExpress.Xpf.Grid.EditGridCellData' (HashCode=2852273); target element is 'DevExpress.Xpf.Editors.TextEdit' (Name=''); target property is 'EditValue' (type 'System.Object')..
System.Windows.Data Error: BindingExpression path error: 'secUserName' property not found on 'DevExpress.Xpf.Editors.TextEdit' 'DevExpress.Xpf.Editors.TextEdit' (HashCode=19675928). BindingExpression: Path='secUserName' DataItem='DevExpress.Xpf.Grid.EditGridCellData' (HashCode=2852273); target element is 'DevExpress.Xpf.Editors.TextEdit' (Name=''); target property is 'EditValue' (type 'System.Object')..

vb.net

Public Sub New()
        InitializeComponent()
        Me.Title = ApplicationStrings.HomePageTitle

        '<!-- load the datagrid -->
        Module1._Context.Load(Module1._Context.GetGESECsQuery())
        GridControl1.DataSource = Module1._Context.GESECs
        GridControl1.DataContext = Module1._Context.GESECs

    End Sub

XAML

 <dxg:GridColumn Header="TRAIL" FieldName="secUserName" >
 <dxg:GridColumn.DisplayTemplate>
 <ControlTemplate>
 <StackPanel>
 <dxe:TextEdit  EditValue="{Binding  Path=secUserName}"></dxe:TextEdit>
 </StackPanel>
 </ControlTemplate>
 </dxg:GridColumn.DisplayTemplate>
 </dxg:GridColumn>

问题

单击编辑文本时(通过将行置于编辑模式(侧面有铅笔图),将显示SECUSERNAME的内容

Problem

When the edittext is clicked (there by bringing the row in edit mode {with the pencil diagram on its side}) the content of the SECUSERNAME is displayed

但是在仅显示记录的正常情况下,textedit不会显示任何内容.

But in the normal condition of just displaying the records, the textedit does not display anything.

是的,调试器显示secusername无效,但是为什么?我应该怎么做才能做到这一点?

Yes, the debugger show that the secusername is not valid, but why? What should I do to make this right?

推荐答案

请尝试如下更改绑定代码:

Please try to change your binding code as follows:

"{Binding Path= DisplayText, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"

它对您有用吗?

这篇关于VS10调试器表示无法在Silverlight应用程序中找到数据源列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆