Pregunta

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.

¿Fue útil?

Solución

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>

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top