We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TextBox filter

is there a way to user asp textbox as grid filter?

3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team July 1, 2016 10:28 AM UTC

Hi Voda, 

Thank you for contacting Syncfusion support.   
We created a sample where we created an external ASP textbox. After mentioning the values in the textbox, then click search button to filter the particular column using filterColumn method of ejGrid.   
If we have misunderstood your query, please elaborate your requirement to provide better solution.   

Find the code example and sample: 

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent"> 
    <asp:TextBox ID="textbox" runat="server"></asp:TextBox> 
      <ej:Button ID="button" ClientSideOnClick="changed" Type="Button" runat="server" Text="search"></ej:Button> 
        <ej:Grid ID="Grid" runat="server" AllowSorting="true" AllowPaging="true"> 
    function changed(args) { 
        var gridObj = $("#<%=Grid.ClientID%>").ejGrid("instance"); 
        gridObj.model.allowFiltering = true; 
        var value = $("#<%=textbox.ClientID%>").val(); 
        gridObj.filterColumn("CustomerID", "contains", value, "and", true);    } 

Prasanna Kumar N.S.V 

HV Hrvoje Voda July 1, 2016 10:38 AM UTC

After I put this code, refresh button stop working.
Row became editable - I don't want that.

Is there a way to do it vb.net code behind?

PK Prasanna Kumar Viswanathan Syncfusion Team July 4, 2016 11:35 AM UTC

Hi Hrvoje, 

Thanks for the update. 

In the last update, we have updated the sample with non-editable grid and you have mentioned the rows become editable after you put the mentioned code. So, please provide the following details to validate the issue,   
1. You have also mentioned that the refresh button stopped working. So, please share the use of the refresh button.  
2. Code example of an rendered Grid. 

3.  Essential Studio Version details. 

Prasanna Kumar N.S.V 

Live Chat Icon For mobile
Up arrow icon