Hi,
If the user opens the Custom Filter Selection, he can enter in nthe operation the (All) operation, that causes strange behavior.
How can it be solved? How can I remove the (all) from the list?
Hello,
The items in these XamComboEditors are determined runtime as they depend on the type of the fields. Therefore, you will have to remove them when the control is loaded. What you can do is to subscribe for the DropDownOpened event of the xamComboEditor and remove them from there. A simple example :
void xamDataGrid1_CustomFilterSelectionControlOpening(object sender, CustomFilterSelectionControlOpeningEventArgs e)
{
e.Control.AddHandler(XamComboEditor.DropDownOpenedEvent, new RoutedEventHandler(OnDropDownOpened));
}
public void OnDropDownOpened(object sender, RoutedEventArgs e)
XamComboEditor editor = (e.OriginalSource as XamComboEditor);
if (editor != null)
ComboBoxItemsProvider provider = editor.ItemsProvider;
ObservableCollection<FilterDropDownItem> source = provider.ItemsSource as ObservableCollection<FilterDropDownItem>;
if (source.Where(x => x.DisplayText.Contains("All")).Count() > 0)
source.Remove(source.Where(x => x.DisplayText.Contains("All")).FirstOrDefault());