This is a migrated thread and some comments may be shown as answers.

Disable Expand/Collapse button of Detail Tables

1 Answer 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Purushothama
Top achievements
Rank 1
Purushothama asked on 15 Feb 2017, 04:07 PM

Hi,

I have Grid with 2 level of Detail Tables. I am using HierarchyLoadMode="Client". I need to Disable (not hide) Expand button click of 1st Detail Table (DetailTableView1) for few scenarios.

Below is the structure

<telerik:RadGrid........ >

     <MasterTableView ....>

        <DetailTables>

             <telerik:GridTableView  Name="DetailTableView1" ..........>

                 <DetailTables>

                      <telerik:GridTableView Name="DetailTableView2" .........>

I have attached aimage to explain the requirement. Could you please let me know the possible ways to achieve the same?

Regards,

Puru

1 Answer, 1 is accepted

Sort by
0
Purushothama
Top achievements
Rank 1
answered on 08 Mar 2017, 11:49 AM

Hi, 

I was able to solve this issue with below code:

foreach (GridDataItem item in rGrid.MasterTableView.Items)
                    {
                        // Access parent grid here
                        if (item.HasChildItems)
                        {
                            foreach (GridDataItem citem in item.ChildItem.NestedTableViews[0].Items)
                            {
                                Button expandcollapsebtn = (Button)citem["ExpandColumn"].Controls[0];
                                expandcollapsebtn.Attributes.Add("style", "pointer-events:none;");
                            }
                        }
                    }

Tags
Grid
Asked by
Purushothama
Top achievements
Rank 1
Answers by
Purushothama
Top achievements
Rank 1
Share this question
or