Question

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.

Était-ce utile?

La solution

Try this one: 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>

Autres conseils

There should not be any problem in sorting data grid column having validation rules as they are meant only to validate the data. Specify the data what you are trying to sort containing validation rules.

Well, we (I'm the co-developer) missed sort information since we are using datagrid columns templates : WPF4 Datagrid doesn't sort on column headers

It was indeed the cause of non sortable columns.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top