<
telerik:RadGridView
>
<
telerik:RadGridView.Columns>
<
telerik:GridViewComboBoxColumn
IsFilterable="True"
DataMemberBinding="{Binding Path=[confirmedcode], Mode=TwoWay}"
ItemsSourceBinding="{Binding Path=ConfirmedPicklist, Source={StaticResource CurApp}}"
DisplayMemberPath="Value"
SelectedValueMemberPath="Key">
<
telerik:GridViewComboBoxColumn.FilteringControl
>
<
telerik:FilteringControl
/>
</
telerik:GridViewComboBoxColumn.FilteringControl
>
</
telerik:GridViewComboBoxColumn
>
</
telerik:RadGridView.Columns>
</
telerik:RadGridView
>
Items Source is a Dictionary<int, string>
Data Memder is a Dictionary Item.
Filter for that field is displayed, but the filter shown Dictionary Keys. How to make the filter displays the Values of a Dictionary.
5 Answers, 1 is accepted
The filter of GridViewComboBoxColumn will try to display the items it knows about - those from the source of the grid, i.e. the property the column is bound to. We made some improvements and if the column's source is set through ItemsSource - the filter will display the values you want. However, in the case of ItemsSourceBinding, the source can be anything from anywhere and the filter is not aware of the values from it.
Why not trying to work with ItemsSource ? ItemsSourceBinding is used only when the source is a property of the business object the grid is bound to.
Maya
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
The thing is that when you work with ItemsSourceBinding, distinct values in the filtering control cannot be aware (and thus convert) each original value (the one the column is bound to) to a new one (that you want to display - CountryName instead of CountryID for example) since there is no exact and equal connection between a data item and value from the source of the column. And there is no appropriate way for us to notify the grid as the whole logic is inside each customer's business objects.
There is a possibility to convert the original distinct value to a new one (this will be just visual convertion, the data below will be the same) as illustrated in this forum thread. However, this again is appropriate only if you have only one pair of distinct value - item.
The way to go is to expose a new read-only property that will contain the value to be displayed in the combo box column and set it as FilterMemberPath for the ComboBoxColumn.
Maya
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.