I am in the process of adding a filter to asp grid. I have succeeded in showing a text box for filtering in header.
I need to fire server code for filtering whenever user presses enter key in textbox.
So I started with adding event like
txtFilter.Attributes.Add("onkeyup", keyUpScript);
Then I added client script as
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "registerkeyUPScript", registerkeyUPScript, true);
where
string keyUpScript = "keyUPScript(event);";
string registerkeyUPScript = "function keyUPScript(e){\n"
+ "var unicode=e.keyCode? e.keyCode : e.charCode;\n"
+ "if(unicode == '13')\n"
+"{\n"
+" //PostBack code"
+"}"
+"}";
Now how could I postback when ever user enters a string in text box and presses enter key. I also need to rebind the filtered data back to grid
Any help will be appreciated.