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

Auto populate radGrid from search textbox

8 Answers 327 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Amanda
Top achievements
Rank 1
Amanda asked on 20 Jan 2011, 04:53 PM
I want to know if this is possible - I haven't seen anything out there yet.  I have a radTextBox in the header of my radGrid.  When the user enters a letter/number for the name I want the radGrid to autopopulate based upon what is entered in the search box - could be 1 - 7 letters.  Thanks for your help.

8 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Jan 2011, 09:25 AM
Hello,


I hope you can make use of filtering feature in RadGrid to accomplish this. Enable the filtering and hide the GridFilteringItem. Now use the filter() method to filter the grid rows based in text typed in textbox.

The documentation would helpful to get started.
Filter template


-Shinu.
0
Amanda
Top achievements
Rank 1
answered on 21 Jan 2011, 03:51 PM
Instead of using the RadComboBox - can I use radTextBox?
0
Amanda
Top achievements
Rank 1
answered on 21 Jan 2011, 08:21 PM
Also, is there a way when using RadTextBox out of the radGrid - can I update the radGrid based on the search as the user inputs the search.
0
Tsvetina
Telerik team
answered on 26 Jan 2011, 02:16 PM
Hello Amanda,

You can take a look at this Code Library article to see how grid can be filtered by an external textbox control:

Filter RadGrid on external textbox key press

Regards,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Amanda
Top achievements
Rank 1
answered on 26 Jan 2011, 11:08 PM
Thank for this article - I am getting an error though.  Can you please help?  I am getting this error: Microsoft JScript runtime error: 'null' is null or not an object on this $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("FilterGrid");

radgrid - top portion.
 <telerik:RadGrid ID="RadGrid1" runat="server" OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="RadGrid1_NeedDataSource" Skin="Web20"
            AllowFilteringByColumn="False" ShowFilterIcon="false" GridLines="Horizontal" >

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        if (e.Argument.IndexOf("FilterGrid") != -1)
        {
            RadGrid1.Rebind();
        }
    }
0
Tsvetina
Telerik team
answered on 31 Jan 2011, 12:03 PM
Hi Amanda,

I cannot see an obvious reason why the $find() method cannot access the manager. Can you confirm if it is on the same page/user control as the grid? If the grid is in a user control or a content page and the RadAjaxManager control is on another one (the master page for example), you can try using the GetCurrent() method:
$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("FilterGrid");



Greetings,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Amanda
Top achievements
Rank 1
answered on 31 Jan 2011, 08:39 PM
Yes, it is on the same page - it is occurring when you type in the second letter in the search box. 
0
Tsvetina
Telerik team
answered on 03 Feb 2011, 12:48 PM
Hello Amanda,

It is hard to determine the cause of the issue without having the relevant code. Would it be possible that you open a formal support ticket and send us a runnable project demonstrating the issue that you face, so we can debug it locally and provide you with a working solution faster?

Regards,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Ajax
Asked by
Amanda
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Amanda
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or