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

Collapse all rows by default and show expand/collpase images for all rows having child rows

1 Answer 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Krishnan LN
Top achievements
Rank 1
Krishnan LN asked on 23 Mar 2010, 08:57 AM

Hi,
Im using the self referencing grid. By default all the rows are in expanded state but i want to collapse all rows and expand only on click.
I want to use Plus/Minus image instead of default button. But the plus/minus image appears only for parent row amd for the rest normal button is shown.

Following is the aspx grid definition

    <telerik:RadPageView ID="RadPageView2" runat="server">  
        <table border="0" visible= "false" width="100%">  
 <LNWCon:LNGrid ID="grdOrganization" EnableAJAX="True" ShowHeader="true" runat="server"   
Width= "97%" GridLines="None" OnColumnCreated="grdOrganization_ColumnCreated" OnItemCreated="grdOrganization_ItemCreated" 
           OnNeedDataSource= "grdOrganization_NeedDataSource" OnItemDataBound = "grdOrganization_ItemDataBound" OnItemCommand="grdOrganization_ItemCommand" Skin="Black" AutoGenerateColumns="False" > 
           <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" NoDetailRecordsText="No Records To Display" EnableNoRecordsTemplate="false" 
               DataKeyNames= "FolderId,ParentFolderId" Width="100%" HorizontalAlign="Right" ExpandCollapseColumn-ButtonType="ImageButton" ExpandCollapseColumn-CollapseImageUrl="../Images/minus.png" ExpandCollapseColumn-ExpandImageUrl="../Images/plus.png"  ExpandCollapseColumn-Visible="true"> 

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Mar 2010, 10:46 AM
Hello,

You can set the HierarchyDefaultExpanded property of MasterTableView to false in order to collapse all rows when page initially loads. If you want to to customize the expand/collapse images for your inner GridTableView, then you can set the ExpandCollapseColumn-CollapseImageUrl/ExpandCollapseColumn-ExpandImageUrl properties for corresponding GridTableViews.

-Shinu.
Tags
Grid
Asked by
Krishnan LN
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or