I enabled a filter row in my data grid. As soon as I start typing in one of the filter cells, the cell commits and leaves edit mode. As you can see in the attached screen shot, I typed 1 letter and the cell leaves edit mode and I can no longer type. What could cause this?
I like that, thanks.
The Host of the ValueEditor is the ValuePresenter that contains it (assuming it is hosted within something like the DataPresenter) so you could exclude editors that are within a FilterCellValuePresenter. e.g.
var editor = sender as ValueEditor; if (editor.Host is FilterCellValuePresenter) return; if (editor is XamComboEditor || editor is XamCheckEditor || editor is XamDateTimeEditor) editor.EndEditMode(true, true);
if (editor.Host is FilterCellValuePresenter) return;
if (editor is XamComboEditor || editor is XamCheckEditor || editor is XamDateTimeEditor) editor.EndEditMode(true, true);
The filter itself is a drop down with all of the distinct values the column has. What if the user types in one of those values exactly - given that solution, wouldn't the condition be true and edit mode would end even though they are using a filter? The issue would still exist.
Instead, I set the tag of the combo editor in the xaml to something specific for the drop down in my grid. When the event fires, I check to see if the tag of the combo editor is that distinct value. If so, end edit mode. Otherwise, don't.
Hello Eric,
OnDropDownChanged event you may check if the selected value in the comboEditor is a valid value before ending edit mode. That is before the following statement check if the selected text of the comboeditor is one of the items in the editor
((ValueEditor)sender).EndEditMode(true, true);
Any idea on this?