This is a migrated thread and some comments may be shown as answers.

DataMemberBinding with Extended Path Filtering Doens't Work

2 Answers 108 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andie
Top achievements
Rank 1
Andie asked on 30 Apr 2013, 04:40 PM
 I have to GridViewDataColumns in a single grid.  Both have DataMemberBinding set. Both display the information in the grid however filtering does not work on the second one. The only difference betweend the two is one has a long Path than the other. Are there any known bugs with this and is there a work around?

This one works
   <telerik:GridViewDataColumn Width="75"
                                                    MinWidth="75"
                                                    DataMemberBinding="{Binding Path=PaymentSubTypeDetail.PurchaseBased}"
                                                    Header="%"
                                                    IsFilterable="True"
                                                    IsSortable="True" />

This one doesn't work
<telerik:GridViewDataColumn Width="*"
                                                    MinWidth="100"
                                                    DataMemberBinding="{Binding  Path=PaymentSubTypeDetail.ReceiptTicketStyle.Name}"                                                  
                                                    Header="Receipt Style"
                                                    IsFilterable="True"
                                                    IsSortable="True" / >
                       
               

2 Answers, 1 is accepted

Sort by
0
Andie
Top achievements
Rank 1
answered on 30 Apr 2013, 05:41 PM
I added  DataType="{x:Type system:String}"
<telerik:GridViewDataColumn Width="*"
                                                  MinWidth="100"
                                                  DataMemberBinding="{Binding Path=PaymentSubTypeDetail.ReceiptTicketStyle.Name}"
                                                  DataType="{x:Type system:String}"
                                                  Header="Receipt Style"
                                                  IsFilterable="True"
                                                  IsSortable="True"
                                                  Style="{DynamicResource SmallLeftAlignedColumnStyle}"
                                                  x:Uid="telerik:GridViewDataColumn_41" >
0
Dimitrina
Telerik team
answered on 01 May 2013, 09:04 AM
Hello,

This would be expected if the "PaymentSubTypeDetail.ReceiptTicketStyle.Name" property returns a value of type object. As you cannot filter on type object, you should specify the correct DataType to interpret the data as the correct type (as you have done it).
 

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Andie
Top achievements
Rank 1
Answers by
Andie
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or