【问题标题】:Telerik RadGrid- Access Items' GroupFooterTelerik RadGrid- 访问项目的 GroupFooter
【发布时间】:2013-09-20 12:29:28
【问题描述】:

我正在尝试在项目的 ItemDataBound 事件中将内容写入项目的组页脚。 任何人都知道如何从项目本身访问项目的组页脚? 换句话说,我如何在绑定项目对象时从项目对象中获取项目的关联组页脚?

protected void grid_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;

            **GridItemGroupFooter footer = item.GroupFooter** <-- Pseudocode for what I want to do
        }
    }

【问题讨论】:

    标签: c# telerik radgrid


    【解决方案1】:

    你应该这样做

    if (e.Item is GridFooterItem)
    {
      itemtype somenameforitem=(itemtype )grid.FooterRow.FindControl("youritemid");
      //for ex if you need textbox then it will be like this
      //TextBox texte=(TextBox)gridname.FooterRow.FindControl("textboxid");
    }
    

    你也可以这样做。

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多