In my SL application, i m generating columns dynamically in radgrid, even i have filters and FilteringMode="FilterRow",
now for filtering i have textbox, but i need to replace that textbox with ComboBox and bind data to that.
List<String> lstitems = (List<String>)evt.Result;
for (int i = 0; i < lstitems .Count; i++)
{
//rcb.DisplayMemberPath = lstitems [i];
rcb.Items.Add(lstitems [i]);
}
};
objService.ServiceMethodAsync();
}
can u say where i m going wring?
and my FilterEditor class
public class BindDDLforFilter : Telerik.Windows.Controls.GridViewDataColumn
{
public override FrameworkElement CreateFieldFilterEditor()
{
Telerik.Windows.Controls.RadComboBox radComboBox = new Telerik.Windows.Controls.RadComboBox();
// This binding will transfer the significant property of your editor to the filtering view model.
Binding selectedValueBinding = new Binding("Value");
selectedValueBinding.Converter = new ComboBoxFilterEditorConverter();
private class ComboBoxFilterEditorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (Object.Equals(value, Telerik.Windows.Data.FilterDescriptor.UnsetValue))
{
// When the filter is turned off this is what editor will get.
return null;
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null)
{
// When your editor want to turn off the filter this is what it should return.
return Telerik.Windows.Data.FilterDescriptor.UnsetValue;
}
return value;
}
}
}