I have a datagrid with validation rules. But I can not sort the grid on a column that contains a validation rule
Is it possible to sort a datagrid that contains validation rules?
Thanks.
I have a datagrid with validation rules. But I can not sort the grid on a column that contains a validation rule
Is it possible to sort a datagrid that contains validation rules?
Thanks.
对具有验证规则的数据网格列进行排序应该没有任何问题,因为它们仅用于验证数据。指定您尝试排序的包含验证规则的数据。
试试这个:SortMemberPath="Complete"
<DataGrid.Columns>
<DataGridTemplateColumn Header="CustID" SortMemberPath="Complete" MinWidth="90" CanUserSort="True" CanUserResize="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Label Content="{Binding Path=CustID}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
好吧,我们(我是共同开发者)错过了排序信息,因为我们使用的是 datagrid 列模板:WPF4 Datagrid does not sort on column headers
这确实是不可排序列的原因。