How to change 100 range displaying of header labels of integer type.

6 posts, 1 answers
  1. Jiri
    Jiri avatar
    40 posts
    Member since:
    Oct 2013

    Posted 09 Oct 2014 Link to this post

    Hi,

    Is it possible to change displaying of header label of integer type, which is currently displayed by 100 interval as default? For example we would need it for displaying age. The 100 interval can be seen in column headers for example on picture here:

    http://www.telerik.com/help/silverlight/radpivotgrid-features-filtering.html

    Thank you,
    Jiri
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 10 Oct 2014 Link to this post

    Hello Jiri,

    In order to change the shown range you would need to set the Step property of the DoubleGroupDescription as needed. Check the following code snippet:

    <pivot:DoubleGroupDescription PropertyName="Quantity" Step="5" />

    Hope this helps.

    Regards,
    Kalin
    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. DevCraft banner
  4. Jiri
    Jiri avatar
    40 posts
    Member since:
    Oct 2013

    Posted 14 Oct 2014 in reply to Kalin Link to this post

    Hi Kalin,

    Thank you, for your answer, but our scenario is kind of different in that we use RadPivotFieldList so in advance we don't know what fields user will select, so we cannot declare it as you suggest, right?
    Do you have any recommendation in this case? Something like change default range of integers to not be 100? Or is it possible for user to declare it in in the RadPivotFieldList herself somehow?

    Thank you,
    Jiri
  5. Answer
    Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 14 Oct 2014 Link to this post

    Hi Jiri,

    I understand your concern. However you would be able to manage the step at run time by hooking to the PrepareDescriptionForField event of the DataProvider. The event is raised whenever the user adds a description to RadPivotFieldList, so you would be able to check whether this is DoubleGroupDescription from the needed property and set the wanted step. Please check the following code snippet:

    private void LocalDataSourceProvider_PrepareDescriptionForField(object sender, Telerik.Pivot.Core.PrepareDescriptionForFieldEventArgs e)
    {
        var doubleGroupDescription = e.Description as DoubleGroupDescription;
     
        if (doubleGroupDescription != null && doubleGroupDescription.PropertyName == "Quantity")
        {
            doubleGroupDescription.Step = 5;
        }
    }

    For more details about the event of the DataProviders you can check the following article from our online help documentation:
    http://www.telerik.com/help/silverlight/radpivotgrid-events-overview.html

    Hope this will help you achieve the desired.

    Regards,
    Kalin
    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. Jiri
    Jiri avatar
    40 posts
    Member since:
    Oct 2013

    Posted 14 Oct 2014 in reply to Kalin Link to this post

    Hi Kevin,

    Thank you, this is good enough for us.
    Maybe even nicer would be to let the user to declare it in RadPivotFieldList, so this could be an idea for improvement. ;-)

    Regards,
    Jiri
  7. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 16 Oct 2014 Link to this post

    Hi Jiri,

    I would like to thank you for your feedback - we will definitely consider the suggestion for the future versions of the PivotGrid. Meanwhile you can check the following example from our XAML SDK repository which demonstrates how to implement custom ContextMenuBehavior that includes the desired feature - option to change the step at run time from the FieldList:
    https://github.com/telerik/xaml-sdk/tree/master/PivotGrid/CustomContextMenuBehavior

    Hope this helps.

    Regards,
    Kalin
    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.

     
Back to Top
DevCraft banner