Pivot Grid Row Label

7 posts, 2 answers
  1. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 21 Jan 2015 Link to this post

    I use integer fields in Row labels ,but it displays range values instead of integer 

    For Example Shown like below.

    Sec Num    Sec Num
    12456           10000-13000
    42345            40000-50000

  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 23 Jan 2015 Link to this post

    Hello Kumaran,

    Thank you for writing.

    I suppose that you are facing the behavior illustrated in the attached gif file. Note that depending on the field type, such a group descriptor is created. When you populate the pivot with data in correspondence with the Using the DataSource property help article for example, a PropertyGroupDescription is added to the ColumnGroupDescriptions collection. When you hide it and add it again using the field list, a DoubleGroupDescription is created, considering the field type. As a result, a range of numbers is displayed. However, you can change this behavior by subscribing to the DataProvider.PrepareDescriptionForField event and replace the DoubleGroupDescription with a PropertyGroupDescription as follows:
    private void DataProvider_PrepareDescriptionForField(object sender, PrepareDescriptionForFieldEventArgs e)
    {
        if (e.Description is DoubleGroupDescription)
        {
            e.Description = new PropertyGroupDescription() { PropertyName = e.Description.DisplayName, GroupComparer = new GrandTotalComparer() };
        }
    }

    However, if it is not the exact case, please specify in details what is the exact problem that you are facing. It would be greatly appreciated if you provide some screenshots illustrating better the undesired result. Thank you.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Desislava
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 23 Jan 2015 in reply to Dess Link to this post

    Problem is the same,but i didn't get the solution by using Data provider.
    Send me sample project to rectify the problem.
  5. Answer
    Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 26 Jan 2015 Link to this post

    Hi Kumaran,

    Thank you for your reply. 

    I attached a sample demo project as you requested. 

    Hope this will help you. Let me know if you have any another questions.

    Regards,
    Ralitsa
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 26 Jan 2015 Link to this post

    Thanks Ralitsa it works
  7. KUMARAN
    KUMARAN avatar
    28 posts
    Member since:
    May 2014

    Posted 26 May 2015 in reply to KUMARAN Link to this post

    And i want show sum of value colums by removing decimals like shown below.

    1245.00   ->  1245

    1.00          -> 1

  8. Answer
    Ralitsa
    Admin
    Ralitsa avatar
    176 posts

    Posted 27 May 2015 Link to this post

    Hi Kumaran,

    Thank you for writing back. 

    You can set the StringFormat property to custom numeric format. Here is the code snippet: 
    Me.RadPivotGrid1.AggregateDescriptions.Add(New PropertyAggregateDescription() With { _
        .PropertyName = "Freight", _
        .AggregateFunction = AggregateFunctions.Sum, _
        .StringFormat = "#####" _
    })

    I hope this will help you. Let me know if you have any other questions.

    Regards,
    Ralitsa
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready