VS10 调试器显示在 Silverlight 应用程序中找不到数据源列

发布于 2024-10-29 11:25:35 字数 1795 浏览 7 评论 0原文

错误

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

在巴黎塔顶看东京樱花 2024-11-05 11:25:35

请尝试按以下方式更改您的绑定代码:

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

它对您有用吗?

Please try to change your binding code as follows:

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

Does it work for you?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文