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')..
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
<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的内容
但是在正常显示记录的情况下,textedit不会显示任何内容。
是的,调试器显示secusername无效,但为什么?我该怎么做才能做到这一点?
答案 0 :(得分:1)
请尝试更改绑定代码,如下所示:
"{Binding Path= DisplayText, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
它对你有用吗?