Collapse all rows and columns for the initial load

14 posts, 1 answers
  1. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 08 Aug 2012 Link to this post

    Hi,

    How to collapse all rows and columns for the initial load?

    TIA.
  2. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 10 Aug 2012 Link to this post

    Hi Barbaros,

    Could you please elaborate some more on what you are trying to achieve?

    Generally, you could hide the grid entirely or partially both on server and client side whenever you want.

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 10 Aug 2012 Link to this post

    Please refer to below link for the screen-shot.
    [Screen-Shot]

    All rows and Column 2012 (and there will be more like 2013,2014) is collapsed. I would like to do this for the initial load.

    TIA
  5. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 10 Aug 2012 Link to this post

    Hello Barbaros,

    Unfortunately into the CTP version the PivotGrid control does not have any server side API which could be used for achieving the desired functionality. Into the official release version such functionality will be available via server side property. At e meantime to achieve the desired functionality you could try adding the first level grouping items into the CollapsedRowIndexes and CollapsedColumnIndexes collections. I am sending you a simple example which demonstrates that. Please check it out and let me know if it helps you.

    Looking forward for your reply.

    All the best,
    Radoslav
    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. Ricardo Pinto
    Ricardo Pinto avatar
    36 posts
    Member since:
    Sep 2008

    Posted 20 Nov 2012 Link to this post

    Hello!

    Is there any change on this subject with the Beta version available with Q3 2012?

    I have a similar scenario:

    My grid is:
    <telerik:RadPivotGrid AllowPaging="false" Width="100%" ViewStateMode="Inherit" ID="RadPivotGridPayments" runat="server" ColumnHeaderZoneText="ColumnHeaderZone" ShowDataHeaderZone="False" ShowRowHeaderZone="False" ShowColumnHeaderZone="False" Visible="false">
        <ClientSettings>
            <Scrolling AllowVerticalScroll="true" ScrollHeight="300px"></Scrolling>
        </ClientSettings>
        <Fields>
            <telerik:PivotGridRowField DataField="Nome" ZoneIndex="0">
            </telerik:PivotGridRowField>
            <telerik:PivotGridRowField DataField="Data" ZoneIndex="1" DataFormatString="{0:dd-MM-yyyy}">
            </telerik:PivotGridRowField>
            <telerik:PivotGridColumnField DataField="DescricaoDespesa">
            </telerik:PivotGridColumnField>
            <telerik:PivotGridAggregateField DataField="ValorDocumento" Aggregate="Sum" DataFormatString="{0:C}">
            </telerik:PivotGridAggregateField>
        </Fields>
        <SortExpressions>
            <telerik:PivotGridSortExpression FieldName="Nome" SortOrder="Ascending"></telerik:PivotGridSortExpression>
        </SortExpressions>
    </telerik:RadPivotGrid>


    The needdatasource event:
    Protected Sub RadPivotGridPayments_NeedDataSource(sender As Object, e As PivotGridNeedDataSourceEventArgs) Handles RadPivotGridPayments.NeedDataSource
            Dim dt As New DataTable
            dt = ExpensesDataTable()
            RadPivotGridPayments.DataSource = dt
    End Sub

    On a toolbar click, I show a pivotgrid, rebind it and use the code provided by Radoslav:
    RadPivotGridPayments.Visible = True
    RadPivotGridPayments.Rebind()

    Dim names = (From row In ExpensesDataTable.AsEnumerable()
                 Select row.Field(Of String)("Nome") Distinct)
    For Each item As String In names
        RadPivotGridPayments.CollapsedRowIndexes.Add(New Object() {item})
    Next

    It's not very efficient (as I call ExpensesDataTable twice) but it almost works: the pivotgrid is rendered with all the "Nome" items expanded, but if I click on one item, the pivotgrid is shown with all items collapsed except the one I've clicked (as if they were all collapsed previously).

    Any ideas on this issue?
    Thanks in advance!

    Best regards,

    Ricardo.


  7. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 23 Nov 2012 Link to this post

    Hello Ricardo,

    For the official release (Q1 2013) the RadPivotGrid control will have richer server side API which will allow collapsing all levels or just a single level. However into the beta version this could be achieved only with custom code.  
    Additionally regarding the described issue:
    I tried to reproduce it on my side, but to no avail. Could you please send us a small runnable example where the problem could be reproduced?  You could open a formal support ticket from your Telerik account and attach a ZIP file there. Thus we will be able to get more information about your scenario and provide you more to the point answer. Looking forward for your reply.

    All the best,
    Radoslav
    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.
  8. manish
    manish avatar
    23 posts
    Member since:
    Sep 2007

    Posted 07 Feb 2013 Link to this post

    is this feature being added in the latest release of radpivotgrid.

    i tried to find it on the demo version site http://demos.telerik.com/aspnet-ajax-beta/pivotgrid/examples/rangegrouping/defaultcs.aspx
    which has the latest beta but could not find any reference to this feature. 

    please let me know. 
    thanks

  9. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 12 Feb 2013 Link to this post

    Hi Manish,

    Into the Q1 2013 beta version of our control the RadPivotGrid has two new properties which controls the initial expand/collapse state of the row header and column header tables groups: RowGroupsDefaultExpanded and ColumnGroupsDefaultExpanded. You can download the beta version from your account and test these properties.

    If you need further assistance, do not hesitate to contact us again.

    Greetings,
    Radoslav
    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.
  10. comgiu
    comgiu avatar
    29 posts
    Member since:
    Jun 2011

    Posted 22 Feb 2013 Link to this post

    hi,
    I've 3 zones
    I start the grid with rows collapsed 
    RadPivotGrid1.RowGroupsDefaultExpanded = false;

    but I need that when I expand a row, will be expanded only one zone at time

    thanks

    PS: I need something like this 
    http://www.mzsolutions.eu/mzPivotGrid-configurator.html
  11. Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 26 Feb 2013 Link to this post

    Hello Comgiu,

    Indeed I verified that the RowGroupsDefaultExpanded=”false”  forces the RadPivotGrid to work as you describe. I will forward your requirement to our developers for further consideration.
    At a meantime to achieve the desired functionality you could try using the following code snippet:
    protected override void OnLoad(EventArgs e)
    {
            base.OnLoad(e);
     
            if (!IsPostBack)
            {
                    for (int i = 0; i < RadPivotGrid1.Fields.Count(f => f.ZoneType == PivotGridFieldZoneType.Row && !f.IsHidden); i++)
                    {
                        RadPivotGrid1.CollapseAllRowGroups(i);
                    }
             }
     }

    I hope this helps.

    Kind regards,
    Radoslav
    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.
  12. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 29 Mar 2013 Link to this post

    Radoslav,

    Sorry but I can verify that it's not working. I need same functionality as comgiu. RowGroupsDefaultExpanded = false collapses all rows, which is fine, but when I expand first row, it expands all sub rows too. Our need is expanding only the next level of rows. By the way, if I use the code snippet given by you, it gives me "Type 'Telerik.Web.UI.PivotGrid.Core.NullValue' in Assembly 'Telerik.Web.UI, Version=2013.1.305.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' is not marked as serializable" error.
  13. Answer
    Radoslav
    Admin
    Radoslav avatar
    1564 posts

    Posted 03 Apr 2013 Link to this post

    Hi Barbaros,

    Our developers have fixed the described issue related with the RowGroupsDefaultExpanded set to "false". The fix will be available into the Q1 SP1 version of our controls which will be published tomorrow.

    Please excuse us for the temporary inconvenience.

    All the best,
    Radoslav
    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.
  14. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 04 Apr 2013 Link to this post

    Thanks, I have just upgraded to Q1 SP1 and confirm that it's working as expected.
  15. Javier
    Javier avatar
    16 posts
    Member since:
    Feb 2015

    Posted 10 Jun 2015 Link to this post

    Hi

     

    RadPivotGrid1.RowGroupsDefaultExpanded = false;

     

    Works nice, 

     

    thanks

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017