Reputation: 21
I think I'm screwed here, but thought I would ask in hopes that maybe somebody knows some magic I can't find on Google.
I have a RadGrid setup to filter columns with a FilterDelay="500" value set. FilterDelay causes the grid to automatically do a postback when somebody types something in the filter box (after the specified delay). It's basically an automatic filter (no need to click OK or some other button to activate the filter).
I dig this functionality - but it interferes with another function of my app that is even more important to me - I trap the INS key so the user can just press INS at anytime to add a new row to the grid.
The problem is that with FilterDelay set, it sees the INS key as a keystroke from the user and performs the postback - even though the user has not altered the text in the filter textbox in any way. Which forces a refresh of the page and cancels my add row function.
I would call this a bug in RadGrid. It should only postback if the string in the filter textbox changes. Non printable chars such as INS (or UP/DOWN/CAP LOCK/etc) should be ignored by the function.
So the question: does anybody have any clever ideas that might help me workaround this issue?
Upvotes: 2
Views: 1043
Reputation: 194
Not sure exactly how you would do it, but in the RadGrid's ClientSettings ClientEvents you can handle the OnCommand event. From there, you can detect a Filter event
if(eventArgs.get_commandName() == "Filter")
From there, if you can somehow know the INS key was pressed, you could cancel the filter event
eventArgs.set_cancel(true);
Upvotes: 1