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
1405
Templte column in Child Grid
posted

Hi,

I have a webhierarchicaldatagrid with parent rows and child rows. In child grid I have added a template column containing a link button. On click of that link button I want to show/hide another grid. Can someone please tell me how to find a button control inside child grid and do a postback on that on client side.

 

Thanks,

Megha

Parents
No Data
Reply
  • 8160
    posted

    Hello Megha,

    You could handle ItemCommand event:

     

        protected void WebHierarchicalDataGrid1_ItemCommand(object sender, Infragistics.Web.UI.GridControls.HandleCommandEventArgs e)

        {

            if (e.CommandName == "HideGrid")

            {

                //Command Argument return clicked row id

                if (e.CommandArgument == "0")

                {

                    //hide grid 1

                }

                else

                {

                    //hide grid 2

                }

            }

        }

     

     

        <ig:TemplateDataField Key="TemplateField_0">

                            <Header Text="TemplateField_0" />

                            <ItemTemplate>

                                <asp:LinkButton ID="LinkButton1" runat="server" CommandName="HideGrid" CommandArgument=<%# DataBinder.Eval(((Infragistics.Web.UI.TemplateContainer)Container).Item, "Row.Index") %>>Hide</asp:LinkButton>

                            </ItemTemplate>

                        </ig:TemplateDataField>

Children
No Data