I'm having difficulty finding a way to accomplish what I want to do.
My Webform has the following controls on it:
1. RadTextBox
2. RadButton
3. RadGrid
Very simple. The user is prompted (RadTextBox) to enter the first letters of the customer name that they would like to view (RadGrid). When they click on the view button (RadButton), the code behind executes in button click event to query the data and executes a .Rebind to refresh the RadGrid. That all works very well. My problem is that I'm trying to find a way to empty the RadGrid datasource when the user clicks back into the RadTextBox and it receives focus. I found a few lines of Javascript in another post on the Telerik forms.
Here is the script:
var masterTable = $find("<%= RadGrid_CustData.ClientID %>").get_masterTableView();
masterTable.set_dataSource([]);
masterTable.dataBind();
I am able to execute this javascript code from a client-side button click event, but it fails when I try to execute it from the RadTextBox OnFocus client event.
Does anyone have any ideas on how I can accomplish this ?
Thank you