This is a migrated thread and some comments may be shown as answers.

Get Filter Textbox from JavaScript

2 Answers 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Corina
Top achievements
Rank 1
Corina asked on 17 Nov 2011, 06:05 PM
Hi

I have a radgrid that has a GridBoundColumn with the ability to be searched. I want to include a list of links outside the grid that provides an alphabet for the user to search by.

This alphabet would be the equivalent to typing 'A' (for example) into the search box and clicking 'Starts With'. Correct me if I'm wrong but I think the best approach for this would be to somehow use javascript to simulate this action.

When the user clicks the 'A' link I want to find the search textbox and put an 'A' in it and do filterButton.click(). However, I cannot find the search button in the grid because it doesn't exist in the page. It gives me an error that it can't find the textbox I'm searching for.

Any suggestions welcome

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Antonio Stoilkov
Telerik team
answered on 21 Nov 2011, 05:18 PM
Hello Corina,

I have assembled a sample project demonstrating the desired functionality. The code below calls a filter function on the RadGrid and is the solution which you are searching for.

function alhabetClick(value) {
    var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
    masterTable.filter("Name", value, Telerik.Web.UI.GridFilterFunction.StartsWith, true);
}

All the best,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Corina
Top achievements
Rank 1
answered on 22 Nov 2011, 03:39 PM
Thanks, that's exactly what I needed.
Tags
Grid
Asked by
Corina
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Corina
Top achievements
Rank 1
Share this question
or