获取Telerik的radgrid控件的行 [英] Get rows of a Telerik RadGrid

查看:1289
本文介绍了获取Telerik的radgrid控件的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个radgrid控件,我想访问其行,但现在看来,这并没有一个 .Rows 属性。

I'm working on a RadGrid, and I want to access its rows but it seems it does not have a .Rows property.

下面是我曾尝试到现在为止:

Here's what I have tried until now:

如何访问 rgCustomers 的行集?我想一个按钮添加到每一行。

How can I access rgCustomers's Rows collection? I want to add a button to each row.

推荐答案

根据 Telerik的文档

每个动态行中的网格重presents从指定数据源的记录。动态行再由GridDataItem类(的GridItem的后代)psented $ P $。

"Each dynamic row in the grid represents a record from the specified data source. Dynamic rows are represented by the GridDataItem class (a descendent of GridItem).

每个GridTableView有一组类型GridDataItem行(Items集合)的。

Each GridTableView has a set of rows (the Items collection) of type GridDataItem."

所以,你要使用的网格,这是GridDataItems集合的项目集合。

So you want to use the Items collection of the grid, which is a collection of GridDataItems.

protected void btnLoad_Click(object sender, EventArgs e)
{
  rgCustomers.DataSource = odsCustomers;
  rgCustomers.DataBind();
  foreach (GridDataItem row in rgCustomers.Items)
  {
  }
}

这篇关于获取Telerik的radgrid控件的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆