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

How to implement a button to Expand All and Collapse All Grid items ?

2 Answers 346 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joselina
Top achievements
Rank 1
Joselina asked on 05 Feb 2014, 09:59 PM
This is the Grid where i need to add the button (with arrow mark in the place of the Text) in the Master Table View before the GridBound column (ListName) . Please help me to add this .
<st:STGrid ID="stGrdNotesMaster" runat="server" TabIndex="212" AutoGenerateColumns="false" AllowSorting="false" AllowPaging="false" ClientSettings-AllowColumnsReorder="false" ClientSettings-AllowDragToGroup="false" ShowGroupPanel="false" >
                                            <MasterTableView DataKeyNames="ID" HierarchyDefaultExpanded="false" NoMasterRecordsText="" NoDetailRecordsText="" GroupLoadMode="Client" HierarchyLoadMode ="Client" >
                                                <Columns>
                                                    <telerik:GridBoundColumn HeaderText="ListName" DataField="Name" UniqueName="ListName" />
                                                    <telerik:GridTemplateColumn UniqueName="Reorder">
                                                        <ItemTemplate><st:STButton ID="btnReorder" runat="server" CommandName="reorder" Text="Reorder based on sort" /></ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                </Columns>
                                                <DetailTables>
                                                    <telerik:GridTableView Name="Detail" AllowSorting="true" AllowPaging="false" DataKeyNames="ID" NoMasterRecordsText="" NoDetailRecordsText="" EditMode="InPlace">
                                                        <Columns>
                                                            <telerik:GridHyperLinkColumn UniqueName="Subject" HeaderText="Subject" DataNavigateUrlFormatString="~/notedisplay.aspx?id={0}" DataNavigateUrlFields="ID" DataTextField="Subject" SortExpression="Subject" ItemStyle-CssClass="gridhyperlink" HeaderStyle-Width="500px" />
                                                            <telerik:GridHyperLinkColumn UniqueName="Attachment" HeaderText="Attachment" DataNavigateUrlFormatString="javascript:void(window.open('imageviewer.aspx?a=3&b=Attachment&c={0}', '_blank', 'left=0, top=0, width=785, height=585, titlebar=yes, location=no, status=no, toolbar=no, menubar=no, scrollbars=no, resizable=yes'));" DataNavigateUrlFields="ID" DataTextField="AttachmentName" SortExpression="AttachmentName" ItemStyle-CssClass="gridhyperlink" />
                                                            <telerik:GridBoundColumn UniqueName="AddDate" HeaderText="Created" DataField="AddDate" SortExpression="AddDate" ReadOnly="true" />
                                                            <telerik:GridNumericColumn  HeaderText="Position" DataField="SortOrder" SortExpression="SortOrder" UniqueName="SortOrder" />
                                                            <telerik:GridEditCommandColumn UniqueName="EditColumn">
                                                                <ItemStyle CssClass="gridhyperlink" />
                                                            </telerik:GridEditCommandColumn>
                                                        </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                            </MasterTableView>
                                            <ClientSettings AllowExpandCollapse="true">
                                            </ClientSettings>
                                        </st:STGrid>


Thanks
Joselina

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Feb 2014, 03:12 AM
Hi Joselina,

RadGrid’s hierarchy structure has been extended with buttons in the hierarchy expand column headers that allow all detail items on a given level to be expanded/collapsed. Please set EnableHierarchyExpandAll property of the RadGrid to true to enable it.

ASPX:
<telerik:RadGrid EnableHierarchyExpandAll="true". . >

Thanks,
Princy
0
Joselina
Top achievements
Rank 1
answered on 06 Feb 2014, 09:22 PM
Thanks Princy. It helped a lot
Tags
Grid
Asked by
Joselina
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Joselina
Top achievements
Rank 1
Share this question
or