2

I have enabled filtering in my RadGrid as follows

 <telerik:RadGrid ID="gvSample" AllowMultiRowSelection="True" runat="server"
        GridLines="None" CellSpacing="1" Skin="WebBlue" AllowPaging="false" PageSize="50"
        AllowFilteringByColumn="true">

In the Item command I need to get the value entered in the filter textbox in the second column. How can I get it? I had tried the following but it wont gives the actual output?

Private Sub gvSample_ItemCommand(ByVal sender As Object, ByVal e As elerik.Web.UI.GridCommandEventArgs) Handles gvSample.ItemCommand
    lblMsg_.Text=gvSample.FilterMenu.Items(1).Text
End Sub
Tony L.
  • 17,638
  • 8
  • 69
  • 66
  • Please, put in the question what you where expecting too see in lblMsg and what you are getting with your code. – Jauch Dec 13 '14 at 10:56

1 Answers1

0

Below sample code explains it

Private Sub gvSample_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) 
    If e.CommandName = RadGrid.FilterCommandName Then           
            lblMsg_.Text = gvSample.MasterTableView.GetColumn(col[1].UniqueName).CurrentFilterValue.ToString()          
    End If
End Sub

Reference can be reached here

Also, you can reach more details and sample code in both C# and VB.NET from Telerik site itself Here is the demo for filtering

Updated: Make sure you set AutoPostBackOnFilter="true" in your markup

Muhammad Gouda
  • 849
  • 8
  • 20