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>
问题
当单击 edittext 时(通过将行置于编辑模式{铅笔图在其一侧}),将显示 SECUSERNAME 的内容,
但在仅显示记录的正常情况下,文本编辑不显示任何内容。
是的,调试器显示 secusername 无效,但为什么呢?我应该怎么做才能纠正这个问题?
The error
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')..
The 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
The 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>
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
But in the normal condition of just displaying the records, the textedit does not display anything.
Yes, the debugger show that the secusername is not valid, but why? What should I do to make this right?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请尝试按以下方式更改您的绑定代码:
它对您有用吗?
Please try to change your binding code as follows:
Does it work for you?