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

based on textbox keypress, search and filter data inside radgridview

3 Answers 307 Views
Grid
This is a migrated thread and some comments may be shown as answers.
zeet
Top achievements
Rank 1
zeet asked on 02 Dec 2010, 12:01 AM
Hi,
I'm developing webform with radgrid...it has textbox and when we type or press key in textbox it should start searching in radgrid and should disply onluy those records inside master-detail gris both...I'm new and do not have much idea...Could you please help me out??

code:

 

 

<telerik:RadGrid ID="RadGridComment" runat="server" OnItemCommand="RadGridComment_ItemCommand" AutoGenerateColumns="False" AllowMultiRowSelection="False"

 

 

 

GridLines="None" ShowGroupPanel="true" ShowHeader="false" MasterTableView-CommandItemDisplay="Top" >

 

 

 

<MasterTableView>

 

 

 

 

<CommandItemTemplate>

 

 

 

<asp:Table ID="tblSearch" runat="server" CssClass="search__background-image_png" Width="100%" Height="20%" CellPadding="0" CellSpacing="0">

 

 

 

<asp:TableRow>

 

 

 

<asp:TableCell Width="5%" Height="37px">

 

 

 

</asp:TableCell>

 

 

 

<asp:TableCell>

 

 

 

<asp:TextBox ID="txtSearch" runat="server" Width="225px" Height="20px" OnTextChanged="txtSearch_TextChanged"></asp:TextBox>

 

 

 

</asp:TableCell>

 

 

 

<asp:TableCell Width="40%" Height="25%">

 

 

 

<asp:RadioButton ID="rbtnSearchOption1" runat="server" GroupName="MessageSearch"

 

 

 

Text="Search in Titles only" Checked="true" Style="font-family: verdana; color: Black; font-style: normal;

 

 

 

 

font-size: 8pt; font-weight: lighter;" />

 

 

 

<asp:RadioButton ID="rbtnSearchOption2" runat="server" GroupName="MessageSearch"

 

 

 

Text="Search in all text" Style="font-family: verdana; color: Black; font-style: normal;

 

 

 

 

font-size: 8pt; font-weight: lighter;" />

 

 

 

</asp:TableCell>

 

 

 

<asp:TableCell Width="5%" Height="25%" HorizontalAlign="Right">

 

 

 

<div class="collapsed_ICON_png" >

 

 

 

</div>

 

 

 

</asp:TableCell>

 

 

 

<asp:TableCell Width="55%" Height="25%" HorizontalAlign="Left">

 

 

 

<asp:Label ID="lblSearchMsg" runat="server" Text="(1) records found" Style="font-family: Verdana;

 

 

 

 

color: Black; font-style: normal; font-size: 9pt; font-weight: lighter;"></asp:Label>

 

 

 

</asp:TableCell>

 

 

 

</asp:TableRow>

 

 

 

</asp:Table>

 

 

 

</CommandItemTemplate>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn SortExpression="id" Display="false" DataField="id" UniqueName="id">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn SortExpression="Name" HeaderButtonType="TextButton" DataField="title"

 

 

 

UniqueName="companyName">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn SortExpression="Date" HeaderButtonType="TextButton" DataField="commentDate"

 

 

 

UniqueName="commentDate">

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="DeleteComment" ImageUrl="Images/delete_msg.png">

 

 

 

</telerik:GridButtonColumn>

 

 

 

</Columns>

 

 

 

<NestedViewSettings>

 

 

 

<ParentTableRelation>

 

 

 

<telerik:GridRelationFields DetailKeyField="id" MasterKeyField="id" />

 

 

 

</ParentTableRelation>

 

 

 

</NestedViewSettings>

 

 

 

<NestedViewTemplate>

 

 

 

<asp:Panel ID="pnlNotices" runat="server" ScrollBars="Auto">

 

 

 

<fieldset style="padding: 10px;">

 

 

 

<asp:Table ID="tblMsg" runat="server">

 

 

 

 

<asp:TableRow Width="999px" Height="30px">

 

 

 

<asp:TableCell ID="tdcn" Text='<%#Bind("comment")%>'>

 

 

 

 

</asp:TableCell>

 

 

 

</asp:TableRow>

 

 

 

</asp:Table>

 

 

 

</fieldset>

 

 

 

</asp:Panel>

 

 

 

</NestedViewTemplate>

 

 

 

</MasterTableView>

 

 

 

</telerik:RadGrid>

 


thanks
patel

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 06 Dec 2010, 05:40 PM
Hi Patel,

I believe this Code Library article implements exactly the same requirement as yours:
Filter RadGrid on external textbox key press

Best wishes,
Tsvetina
the Telerik team
Browse the vast support resources we have to jumpstart 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
Felipe de Jesús
Top achievements
Rank 1
answered on 04 Oct 2011, 08:47 PM
Hello everyone.

Trying to implement the solution described in the Code Library Filter RadGrid in key external media text, but when I write something in the filter textbox I get the error described in the picture attached to this post
.

My filter textbox it's in ContentPage and inside in an Update Panel.

King Regards.
Felipe Meléndez.
0
Tsvetina
Telerik team
answered on 05 Oct 2011, 11:26 AM
Hi Felipe De Jesús,

If you use the exact same javascript as in the Code Library, it will not work because the UpdatePanel control does not have an ajaxRequest method.

You could replace the update panel with a RadAjaxPanel and see if it works this way. If not, paste the code related to this functionality, so that we can see what is wrong with it.

Regards,
Tsvetina
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
Tags
Grid
Asked by
zeet
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Felipe de Jesús
Top achievements
Rank 1
Share this question
or