wpf bombox/comboboxedit在datagrid/gridcontrol row yeack in froce from from from from from from from from from froce from from from from from from from from from from from from from from from from from from from Outer Row

发布于 2025-02-03 03:13:56 字数 519 浏览 4 评论 0原文

我在网格控制内有一个devexpress组合。 DataGridrow内部的Afaik Combobox有相同的问题。

EditValue在行?内部:

EditValue="{Binding Row.Selected}"

还可以。

当前,项目库=所有可能的选项的列表也位于行对象内部。

ItemsSource="{Binding Row.AllPossibilities}"

它有效,但我不希望对象太多 - 然后,它必须包含大多数属性的所有可能选项的列表。

这就是为什么我有什么机会在WPF USerControl的数据附件中,而是在UserControl内部的GridControl的数据表室内。

我尝试在USERCONTROL DATACONTEXT中使用路径和名称设置项目源,但是让Xaml-BindingError认为该属性是在类型的“ EditgridCelldata”对象中找到的,

甚至可能吗?如果是,怎么样?

i have a DevExpress ComboBoxEdit inside a GridControl.
Afaik ComboBox inside a DataGridRow has the same problem.

EditValue is inside the row-object:

EditValue="{Binding Row.Selected}"

Thats ok.

Currently the ItemsSource = List of all possible options is also inside the row-object.

ItemsSource="{Binding Row.AllPossibilities}"

It works but i don't like to clutter the object too much - it has then to contain lists of every possible option for most of the properties.

Thats why i what to chance the ItemsSource to be in the DataContext of the WPF UserControl instead the DataContext of the GridControl inside the UserControl.

I tried setting the ItemsSource with Path and name in the UserControl DataContext but got XAML-Bindingerror that the Property is not found in object of type "EditGridCellData"

Is that even possible? If yes, how?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

月下凄凉 2025-02-10 03:13:56

找到了一个解决方案:

ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}},Path=AllPossibilities,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"

Found a solution:

ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}},Path=AllPossibilities,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文