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

Column Filter not activated when using converter binding

1 Answer 91 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Manas
Top achievements
Rank 1
Manas asked on 17 May 2011, 05:28 PM
Hello there,
the column filter is not getting activated for a grid column when it is using a converter for it's binding. In this column case the RelatedOrderIDs property returns a List<string> and the converter converts it to a comma separated string. The data is being populated and I can see the CSV string in the column but the filter icon does not appear in the column header.


<telerik:GridViewDataColumn Header="Related Orders" DataMemberBinding="{Binding RelatedOrdeIDs}" Width="200" ShowFieldFilters="True">
    <telerik:GridViewDataColumn.CellTemplate>
        <DataTemplate>
            <StackPanel>
                <TextBlock Text="{Binding RelatedOrdeIDs, Converter={StaticResource listToStringCSVConverter}}" ToolTipService.ToolTip="{Binding RelatedOrdeIDs, Converter={StaticResource listToStringConverter}}" />
            </StackPanel>
        </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>

Can you please help?

Thanks,
Manas

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 18 May 2011, 10:06 AM
Hello Manas,

 In order to have filtering you need to bind the data column to comparable data types. When you bind to List<string> the filtering does not know how to compare two objects of this type and that is why there is not filtering. When you apply a converter it is changing the value at visual level only, the original associated object is still List<string>.

The best approach when you want to have the inbuilt filtering and sorting is to use simple data objects like string and bind directly to them. 

I hope that this could solve your problem. If you have other questions regarding filtering, please do not hesitate to contact us.

Regards,

Didie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Manas
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or