13 Answers, 1 is accepted
One way to achieve this functionality is by adding FilterExpression in SqlDataSource control. Now pass the TextBox's Text in the FilterParameters of the SqlDataSource which provides the data to the RadGrid. Following mark-up shows similar approach.
Or you can refer the following code library which explains how to filter the records in RadGrid on key press from a textbox outside of the grid.
Filter RadGrid on external textbox key press
I did cutomize the filter and make the search on the Enter key press. It is excelent!, but the searches no work good in all occasions.
There are any way that put the textbox of filter on the columns names of the radgrid?.
Respect to Popup editform, this popup can fire through other button?, thanks for all.
I am attaching a sample project demonstrating one way to achieve the functionality described by you. Please, check if this covers all your requirements.
As for the popup edit form - it is the same like with the other edit forms, it is shown on switching an item (row) into edit mode, no matter how this is done (using CommandItem, a GridEditColumn, etc.). You can find more information on using a popup edit form in this help topic.
the Telerik team
My project is something same how you make the example.
My requirements are if the textbox for the filter can be on of the columnname, out of the grid.
Other thing were if the mastertableview can be fire from other button that not is "Add new record".
Thanks for your help.
You can attach 'onkeydown' client event to the TextBox(which is outside grid) like below.
Then in that event handler directly set the ColumnUniqueName for which you are using that filtering TextBox.
And try the following code to open an insert form in external button click .
mmm, now I have the page like this:
but don't filter the column
Thanks to all
You need to set AllowFilteringByColumn property of RadGrid as true to filter the column.
In this textbox i call doFilter functionfor the filtering the radgrid but not do it.
I don't wanna use the default radgridfilter, Can I filter the columns from other textbox?}
Thanks to all!
If you dont want the default filter item, you can hide it from code behind like below.
Thanks for all Princy, in this moment can't prove your solution but thanks for the response.
See you later
Don't filtering :'(
Debugging the doFilter function the parameters are for:
uniquename = "gtcCodigo"
sender.value = The value of the textbox for ex: 2
and the last parameter is the filter Contains
I made a test and this not func because i have columntamplate, tha columntamplate doesn't has Datafield... I prove with a BoundColumn and the function filter the column very good!
Any idea what can I do the filtering in the columntemplate?
I guess you want to filter a TemplateColumn. If so you can set the DataField property of the template column to the field you want to use for filtering. There is one documentation regarding this. Please go through this for more details.
Implementing filtering for template/custom columns
for all the solution will be this:
This is the function
and the columntemplate will be
Thanks Princy, thanks to all!.