我正在开发使用Telerik Controls for ASP.NET AJAX并使用RadGrid的ItemCommand事件 . 我需要从grid.Items集合中过滤/选择特定项目(或行)?
这是RadGrid中按钮的标记 .
<telerik:GridButtonColumn runat="server" Text="Fill Days" ImageUrl="images/16/disk_blue.png" ButtonType="ImageButton" CommandName="FillDays" HeaderTooltip="Fill for this day" />
而背后的代码:
Protected Sub myDatagrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles myDatagrid.ItemCommand
'as i have lots of rows in table, i don't want to loop through all items.
For Each gridDataItem As GridDataItem In myDatagrid.Items
Next
End Sub
如何过滤这些网格项,以便我具有特定列值的特定项?
任何解决方案将受到高度赞赏 .
1 回答
我在C#工作,但想法是一样的 . 您必须在用于索引表的MasteTable DataKeyName上指定 .
然后使用此索引: