我已在我的RadGrid
中启用过滤,如下所示
<telerik:RadGrid ID="gvSample" AllowMultiRowSelection="True" runat="server"
GridLines="None" CellSpacing="1" Skin="WebBlue" AllowPaging="false" PageSize="50"
AllowFilteringByColumn="true">
在Item命令中,我需要获取在第二列的过滤器文本框中输入的值。我怎么才能得到它?我试过以下但它不会给出实际的输出?
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
答案 0 :(得分:0)
下面的示例代码解释了它
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
可以参考here
此外,您可以从Telerik站点本身获取C#和VB.NET中的更多详细信息和示例代码 Here is the demo for filtering
<强>更新强> 确保设置AutoPostBackOnFilter =&#34; true&#34;在您的标记中