Radgrid Grouping Collapse Expand

8 posts, 0 answers
  1. Rolf
    Rolf avatar
    5 posts
    Member since:
    Sep 2008

    Posted 29 Aug 2011 Link to this post

    Hi
    I have a RadGrid with Grouping, Collapse and Expand functionality.
    That works very well.

    My problem:
    When I click the command "Edit", edit mode = "popup", go to Collapse and Expand selections lost.
    What can I do that the users stay with selection Collapse and Expand exist forever?

    Sorry for my bad English
    Rolf Burri
    Switzerland


    <telerik:RadGrid ID="RadGrid_Zeiten" runat="server" AutoGenerateColumns="False"
    DataSourceID="SqlDataSource_Zeiten" GridLines="Vertical" Skin="Office2007"
    AllowAutomaticUpdates="True" AutoGenerateEditColumn="True"
    style="font-weight: 700">
    <ExportSettings ExportOnlyData="True" IgnorePaging="True">
    </ExportSettings>
    <MasterTableView CommandItemDisplay="None" datakeynames="ID"
    datasourceid="SqlDataSource_Zeiten" editmode="PopUp" font-bold="False"
    font-italic="False" font-names="Verdana" font-overline="False" font-size="8"
    font-strikeout="False" font-underline="False">
    <RowIndicatorColumn>
    <HeaderStyle Width="20px" />
    </RowIndicatorColumn>
    <ExpandCollapseColumn>
    <HeaderStyle Width="20px" />
    </ExpandCollapseColumn>
    <GroupByExpressions>
    <telerik:GridGroupByExpression>
    <SelectFields>
    <telerik:GridGroupByField FieldName="nachname" HeaderText=" "
    HeaderValueSeparator=" " />
    <telerik:GridGroupByField FieldName="vorname" HeaderText=" "
    HeaderValueSeparator=" " />
    </SelectFields>
    <GroupByFields>
    <telerik:GridGroupByField FieldName="username" SortOrder="Ascending" />
    </GroupByFields>
    </telerik:GridGroupByExpression>
    </GroupByExpressions>
    <Columns>
    <telerik:GridBoundColumn DataField="user_id" ReadOnly="True"
    SortExpression="user_id" UniqueName="user_id" Visible="False">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="name_tag" HeaderText="Tag"
    SortExpression="name_tag" UniqueName="name_tag" ReadOnly="True">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Datum" DataFormatString="{0:dd.MM.yyyy}"
    HeaderText="Datum" SortExpression="Datum" UniqueName="Datum"
    ReadOnly="True">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Vorname" HeaderText="Vorname"
    SortExpression="Vorname" UniqueName="Vorname" ReadOnly="True">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Nachname" HeaderText="Nachname"
    SortExpression="Nachname" UniqueName="Nachname" ReadOnly="True">
    </telerik:GridBoundColumn>
    <telerik:GridDateTimeColumn DataField="arbeitszeiten_1_von"
    DataFormatString="{0:HH:mm}" HeaderText="Von" PickerType="TimePicker"
    UniqueName="arbeitszeiten_1_von">
    </telerik:GridDateTimeColumn>
    <telerik:GridDateTimeColumn DataField="arbeitszeiten_1_bis"
    DataFormatString="{0:HH:mm}" HeaderText="Bis" PickerType="TimePicker"
    UniqueName="arbeitszeiten_1_bis">
    </telerik:GridDateTimeColumn>
    <telerik:GridDateTimeColumn DataField="arbeitszeiten_2_von"
    DataFormatString="{0:HH:mm}" HeaderText="Von" PickerType="TimePicker"
    UniqueName="arbeitszeiten_2_von">
    <ItemStyle BackColor="#E6EBF3" />
    </telerik:GridDateTimeColumn>
    <telerik:GridDateTimeColumn DataField="arbeitszeiten_2_bis"
    DataFormatString="{0:HH:mm}" HeaderText="Bis" PickerType="TimePicker"
    UniqueName="arbeitszeiten_2_bis">
    <ItemStyle BackColor="#E6EBF3" />
    </telerik:GridDateTimeColumn>
    <telerik:GridDateTimeColumn DataField="arbeitszeiten_3_von"
    DataFormatString="{0:HH:mm}" HeaderText="Von" PickerType="TimePicker"
    UniqueName="arbeitszeiten_3_von">
    </telerik:GridDateTimeColumn>
    <telerik:GridDateTimeColumn DataField="arbeitszeiten_3_bis"
    DataFormatString="{0:HH:mm}" HeaderText="Bis" PickerType="TimePicker"
    UniqueName="arbeitszeiten_3_bis">
    </telerik:GridDateTimeColumn>
    <telerik:GridDateTimeColumn DataField="arbeitszeiten_4_von"
    DataFormatString="{0:HH:mm}" HeaderText="Von" PickerType="TimePicker"
    UniqueName="arbeitszeiten_4_von">
    <ItemStyle BackColor="#E6EBF3" />
    </telerik:GridDateTimeColumn>
    <telerik:GridDateTimeColumn DataField="arbeitszeiten_4_bis"
    DataFormatString="{0:HH:mm}" HeaderText="Bis" PickerType="TimePicker"
    UniqueName="arbeitszeiten_4_bis">
    <ItemStyle BackColor="#E6EBF3" />
    </telerik:GridDateTimeColumn>
    <telerik:GridBoundColumn DataField="total_zeiten" HeaderText="Total Zeiten"
    UniqueName="total_zeiten" ReadOnly="True" SortExpression="total_zeiten">
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="total_arbeiten" HeaderText="Total Arbeiten"
    ReadOnly="True" SortExpression="total_arbeiten" UniqueName="total_arbeiten">
    </telerik:GridBoundColumn>
    <telerik:GridCheckBoxColumn DataField="abgeschlossen" HeaderText="Gesendet"
    ReadOnly="True" UniqueName="abgeschlossen">
    </telerik:GridCheckBoxColumn>
    </Columns>
    <EditFormSettings>
    <EditColumn UniqueName="EditCommandColumn1">
    </EditColumn>
    <FormStyle BackColor="#E6EBF3" />
    <FormTableStyle BackColor="#E6EBF3" />
    <FormMainTableStyle BackColor="#E6EBF3" BorderStyle="Double" />
    <FormTableItemStyle BorderStyle="Solid" Height="20px" />
    <FormTableAlternatingItemStyle BackColor="White" Height="20px" />
    </EditFormSettings>
    <GroupHeaderItemStyle Font-Bold="True" ForeColor="Black" />
    </MasterTableView>
    <GroupingSettings GroupByFieldsSeparator="" />
    <GroupHeaderItemStyle Font-Bold="True" ForeColor="Black" />
    <FilterMenu EnableTheming="True" Skin="Gray">
    <CollapseAnimation Duration="200" Type="OutQuint" />
    </FilterMenu>
    </telerik:RadGrid>
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Aug 2011 Link to this post

    Hello Rolf,

    Please take a look at the following code library which explains how to persist the groups expanded/collapsed state in RadGrid.
    Persist Groups Expanded State on Rebind

    -Shinu.
  3. Rolf
    Rolf avatar
    5 posts
    Member since:
    Sep 2008

    Posted 30 Aug 2011 Link to this post

    Super!
    What a great support.
    It works perfectly.
    many thanks
    Rolf
  4. Peter
    Peter avatar
    98 posts
    Member since:
    Mar 2012

    Posted 07 Mar 2013 Link to this post

    Thanks.

    Is there anyway then to have the collapsed grid treated as 0 or 1 item, so 9 or 10 more items show from the next group if the page size of the grid is 10? In other words, can the grid ignore collapsed groups in the item count?
  5. Eyup
    Admin
    Eyup avatar
    3841 posts

    Posted 12 Mar 2013 Link to this post

    Hi Peter,

    I am afraid the grid generates values only for the items on the current page. Therefore, the items on the next page are not available at the current time. This behavior depends on the RadGrid implicit grouping logic and currently there are no scheduled plans to modify this behavior.

    I hope the clarification was helpful.

    Kind regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Peter
    Peter avatar
    98 posts
    Member since:
    Mar 2012

    Posted 20 Mar 2013 Link to this post

    No worries Eyup - we haven't had any issues so far - I can just see a user asking about this behaviour one day :).
  7. Frank
    Frank avatar
    7 posts
    Member since:
    Jul 2015

    Posted 02 Feb 2017 in reply to Shinu Link to this post

    Problem still exist. I refuse to put in tons of ugly code as workaround!
  8. Eyup
    Admin
    Eyup avatar
    3841 posts

    Posted 07 Feb 2017 Link to this post

    Hello Frank,

    You can examine the RadGridGetAllSelectedItemsImproved.zip sample provided in the following post and see the implementation demonstrated there:
    http://www.telerik.com/support/code-library/get-selected-items-through-all-pages#1eTU8nr-GUG8zfGgOGbIcA


    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top