1

I have a WPF model with a table "table1" composed by "table1_column1", "table1_column2" and "table1_column3" and another table "table2" composed by "table2_column1", "table2_column2" and "table2_column3".

I have a 0..1 relation from "table1" to "table2", it means that an object from "table1" can be related with 0 or 1 "table2" object.

Now I have create a RadGridView that takes all the table1 objects as ItemsSource. I have the following columns in the RadGridView:

"table1_column1", "table1_column2", "table1_column3", "table2_column1" and everything is working fine, except for two problems: if I try to sort the grid by "table2_column1" or use a filter on "table2_column1", no entry is shown in the table, just the headers.

Sorting and filtering on "table1_column1", "table1_column2" and "table1_column3" work fine. Here is the RadGridView code.

    <telerik:RadGridView.Columns>

        <telerik:GridViewDataColumn x:Name="table1_column1" Header="table1_column1" DataMemberBinding="{Binding Path=table1_column1}" IsReadOnly="true"/>
        <telerik:GridViewDataColumn x:Name="table1_column2" UniqueName ="table1_column2" Header="table1_column2" DataMemberBinding="{Binding Path=table1_column2}" IsReadOnly="true" Width="100" IsAutoGenerated="False"/>
        <telerik:GridViewDataColumn x:Name="table1_column3" Header="table1_column3" DataMemberBinding="{Binding Path=table1_column3}" IsReadOnly="true"/>
        <telerik:GridViewDataColumn x:Name="table2.table2_column1" Header="table2_column1" DataMemberBinding="{Binding Path=table2_column1}" IsReadOnly="true"/>

    </telerik:RadGridView.Columns>
</telerik:RadGridView>

Any suggestion?

1
  • You already tried to use DataField and SortExpression?
    – Odrai
    Dec 4, 2014 at 18:22

1 Answer 1

0

If the data disappears in a RadGridView when sorting or filtering, it's usually a problem with the comparison of objects. Switch on all .net exceptions and it should become clear where the exception is being thrown.

Debug -> Exceptions -> Common Language Runtime Exceptions = true

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.