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
245
WebHierarchicalDataGrid template field link button
posted

I'm using the WebHierarchicalDataGrid with a template field that has a linkbutton; when the grid loads for some users the link button text will be "edit" and for some "view". I already have the change in the text for the parent rows working using the InitializeRow and findcontrol on the row.

I can't figure out how to get child row linkbutton text to change from edit to view depending on my user criteria.

Please see the print screen; the links in the parent (circled in blue) I have working.

I need help with the child links (circled in red).

Thanks for your help, Pat

Parents
No Data
Reply
  • 2535
    Offline posted

    Hi Pat,

    In the WebHierarchicalDataGrid the event InitializeRow is fired for all the rows(in the child and parent grid).

    You can extend you logic and add a check for the row level. For example:

    protected void WebHierarchicalDataGrid1_InitializeRow(object sender, RowEventArgs e)
        {
            if(((ContainerGridRecord)e.Row).Level == 0)
            {
                // Add logic for changing template text for parent
            }
            if (((ContainerGridRecord)e.Row).Level == 1)
            {
                // Add logic for changing template text for child grid
            }
        }

    Let me know if I may be of further assistance.

Children
No Data