【问题标题】:How to get the Telerik RadGrid footer row value?如何获取 Telerik RadGrid 页脚行值?
【发布时间】:2013-09-20 03:09:50
【问题描述】:

使用 C#,如何从 RadGrid 页脚中的文本框中获取值?

我在以下代码中遇到错误。我该如何解决?

TextBox texte=(TextBox)RadGrid1.FooterRow.FindControl("textempno");

【问题讨论】:

  • 您在哪种情况下尝试获取此值/

标签: c#-4.0 telerik radgrid


【解决方案1】:

你应该这样做:

if (e.Item is GridFooterItem)
{
    TextBox texte = (TextBox)RadGrid1.FooterRow.FindControl("textempno");
}

另外,你可以这样做:

GridFooterItem footerItem = (GridFooterItem)RadGrid1.MasterTableView.GetItems(GridItemType.Footer)[0];
TextBox texte=(TextBox)footerItem.FindControl("textboxid");//accessing Button inside FooterTemplate

我在获取网格页脚项目时给出了索引 [0],因为文本框是我的网格页脚中唯一的项目。如果您有多个页脚项目,您可以给出要查找的项目的索引。

【讨论】:

  • 尝试在页脚项中找到它
猜你喜欢
  • 1970-01-01
  • 2012-08-02
  • 1970-01-01
  • 2012-10-03
  • 1970-01-01
  • 2021-09-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多