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

[Solved] Expand/Collapse button in hierarchical grid

5 Answers 375 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam Cole
Top achievements
Rank 1
Adam Cole asked on 05 Feb 2009, 09:32 PM
Hi,
  Few questions about the expand/collapse button in hierarchical grid.
  1.  Is there a way to move the expand/collapse button to the right side of the grid?
  2.  If there is no way to move it, then is there a way to make it invisible?
  3.  I manually added a GridExpandColumn column to my grid, but I got this error message.  Please help me fix it.
    Multiple controls with the same ID 'GECBtnExpandColumn' were found. FindControl requires that controls have unique IDs.


Thanks.

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Feb 2009, 04:22 AM
Hi Adam,

One suggestion will be to hide the autogenerated exapnd/collapse column and add a new Expand/collapse column at the right end with UniqueName set.

CS:

1. To hide the autogenerated Expand/Collapse column

 
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns) 
        { 
            if (col.UniqueName == "ExpandColumn"
            { 
                col.Display = false
            } 
        } 
   }


2. Try adding a new expand/collapse column with UniqueName property set
 
 <telerik:GridExpandColumn  UniqueName="NewExpandColumn" ></telerik:GridExpandColumn> 
 
 


Thanks
Shinu
0
Adam Cole
Top achievements
Rank 1
answered on 06 Feb 2009, 04:24 PM
Thank you.  It's what I need.
0
Gourangi
Top achievements
Rank 1
answered on 18 Apr 2009, 01:28 PM
Hi,

I am using SelfHierarchy.
I just want to hide/change expand/collapse image of leaf nodes (which dont have further sub nodes).
How can I achieve that?

Thanks & Regards,
Divyesh Chapaneri
0
Shinu
Top achievements
Rank 2
answered on 20 Apr 2009, 03:49 AM
Hi Divyesh,

Check out the following help article which explains how to achieve the desired requirement.
Hiding the expand/collapse images when no records in Self-Referencing hierarchy

Shinu
0
Yuvika
Top achievements
Rank 1
answered on 07 Nov 2009, 05:14 AM
Hi,

I want the functionality that expand/collapse button should not be visible for leaf node's. It code example from the following link:
http://www.telerik.com/help/aspnet-ajax/grdhideexpandcollapseimageswhennorecordsinselfreferencinghierarchy.html
works well if HierarchyDefaultExpanded="true", HierarchyLoadMode="ServerOnDemand"
In other case when HierarchyDefaultExpanded="true" is false, it does not work as the nestedView does not bind at once beacuse I have HierarchyLoadMode="ServerOnDemand".
Can I achieve the functionality to hide the leaf node expand collapse button keeping my these 2 properties as it is. As I dont want the user to show the data expanded.
Please reply.

Thanks,
Yuvika
Tags
Grid
Asked by
Adam Cole
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Adam Cole
Top achievements
Rank 1
Gourangi
Top achievements
Rank 1
Yuvika
Top achievements
Rank 1
Share this question
or