Query | Response |
so do I have to use a CellModel AND a CellRenderer? Isn't there a simpler way to delimit the entires of the filter? :) | The GridGroupingControl does not have the direct support to add only some CompareOperator to list in DynamicFilter. This can be achieved by only creating the custom CellModel and CellRenderer. |
just to change the dynamic filter list? Really? | We have customized the sample as per requirement with some CompareOperator items. The operations done by the CompareOperators should be modified to customize the CompareOperator list. So these are the minimal classes should be added to CustomCellModel and CustomCellRenderer. Please make use of the provided sample. In the provided sample, the order of list can be changed in the list box CompareOperatorListPart of GridTableFilterBarExtCell.cs file as in the below code, //Add the compare operators in ListBox this.compareOprListBox.Items.AddRange(new string[] { "Equals","Expression Match","StartsWith", "EndsWith" }); |
Hi Arulpriya,
thank you for your help, I got it to work.
There is still one problem, though:
If I'm typing in the textbox of the filter, the cursor always stays on / jumps to the beginning of the textbox. So if I wanted to insert something in the middle of my input, the cursor will jump to the beginning and my new typed text will be inserted at the end of the textbox.
I saw that the OnKeyPress and OnKeyDown methods are overridden in your example, but I haven't figured out yet, where this "jump to beginning" is happening in the code.
Thanks!
protected override void OnKeyPress(KeyPressEventArgs e) { -----Some codes---- int prevSelectionStart = TextBox.SelectionStart; string newText = TextBoxText.Remove(TextBox.SelectionStart, TextBox.SelectionLength); string s = newText.Insert(TextBox.SelectionStart, (!Char.IsControl(e.KeyChar) ? e.KeyChar.ToString() : string.Empty)); s = s.ToUpper(); if (this.ValidateString(s)) { if (this.NotifyCurrentCellChanging()) { CurrentCell.IsModified = true; SetTextBoxText(s, true); if (charCode != 8 && charCode != 22 && charCode != 0) TextBox.SelectionStart = prevSelectionStart + 1; } } ------Some codes ------ } |
Hello Arulpriya,
thank you, it works!