Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
710
Migrate CellItem reference
posted

Hi, I am migrating from 11.1 to 13.2, I have this code in the click event of a link that's inside a templateDataField in a WebHierarchicalGrid:

protected void lnkEditBoard_Click(object sender, EventArgs e) {

   var replacementDate = GetRateGridCurrentRow().Items.FindItemByKey("ReplacementDate").Value as DateTime?;

   LinkButton lnk = sender as LinkButton;

   CellItem parentCell = (CellItem)lnk.NamingContainer;

   var BoarId = parentCell.Cell.Row.Items.FindItemByKey("BoardId").Value.ToString();

}

Here's the templateDataField:

<ig:TemplateDataField Width="310px" Key="lnkBoardsColumn">
  <ItemTemplate>
    <asp:LinkButton ID="lnkEditBoard" OnClick="lnkEditBoard_Click" runat="server" ForeColor="Navy">
      <%# DataBinder.Eval(Container, "DataItem.Description")%>
    </asp:LinkButton>
  </ItemTemplate>
  <FooterTemplate>
    <asp:LinkButton ID="lnkAddBoard" OnClick="lnkAddBoard_Click" runat="server" ForeColor="Black"
     Font-Bold="true" Font-Size="X-Small">Add Board</asp:LinkButton>
  </FooterTemplate>
  <Footer CssClass="footerStyle">
  </Footer>
</ig:TemplateDataField>

Parents Reply Children