Silverlight GridView 和组合框

发布于 2024-10-20 17:34:34 字数 867 浏览 1 评论 0原文

我的 silverlight 应用程序的网格视图中有一个组合框。

<Controls1:GridViewComboBoxColumn Header="Accomplishment Category" 
ItemsSource="{Binding AccomplishmentCategoryList}" 
DataMemberBinding="{Binding AccomplishmentCategoryValue}"  
SelectedValueMemberPath="{Binding AccomplishmentCategoryValue}">
</Controls1:GridViewComboBoxColumn>

我能够让我的网格显示其自己的 itemSource 的结果。

<Controls1:RadGridView x:Name="Accomplishments" Grid.Row="1" CanUserInsertRows="True" 
ShowInsertRow="True" CanUserDeleteRows="True" RowIndicatorVisibility="Visible" 
IsReadOnly="False" ItemsSource="{Binding AccomplishmentResults, Mode=TwoWay}">

AccomplishmentResults 集合完美绑定。我的问题是组合框不会显示任何内容,直到您实际单击包含组合框控件的列。这样该列看起来是空的,当您单击该列时,会显示结果,当您再次单击时,您会得到一个组合框,该组合框将显示该集合中的项目。如果您选择该列以外的任何内容,这些值就会消失并再次为空。如果您选择该行,它们将保持为空。只有当选择该列时,才会显示这些值。

I have a combobox in a gridview in my silverlight application.

<Controls1:GridViewComboBoxColumn Header="Accomplishment Category" 
ItemsSource="{Binding AccomplishmentCategoryList}" 
DataMemberBinding="{Binding AccomplishmentCategoryValue}"  
SelectedValueMemberPath="{Binding AccomplishmentCategoryValue}">
</Controls1:GridViewComboBoxColumn>

I am able to get my grid to display the results for its own itemSource.

<Controls1:RadGridView x:Name="Accomplishments" Grid.Row="1" CanUserInsertRows="True" 
ShowInsertRow="True" CanUserDeleteRows="True" RowIndicatorVisibility="Visible" 
IsReadOnly="False" ItemsSource="{Binding AccomplishmentResults, Mode=TwoWay}">

The AccomplishmentResults collection binds perfectly. my issue is the combobox does not display anything until you actually click on the column that contains the combobox control. so that column looks empty, when you click on the column the results are displayed, when you click again you get the combobox that will show the items in that collection..if you select anything other than that column those values disappear and are empty again. if you select the row they remain empty..it is only when the column is selected that the values appear.

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

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

发布评论

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

评论(1

等数载,海棠开 2024-10-27 17:34:34

默认情况下,ListView 和 DataGrid 仅显示文本,直到单击该项目并且该项目变得可编辑。

您必须创建模板列,它将始终显示模板中声明的组合框。

By default ListView and DataGrid only displays text till the item is clicked and item becomes editable.

You will have to create Templated Column, that will always display combobox as declared in template.

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