PivotGrid - Setting Default STEP for specific fields.

2 Answers 33 Views
PivotGrid and PivotFieldList
Mark
Top achievements
Rank 2
Bronze
Bronze
Veteran
Mark asked on 17 May 2024, 08:07 PM

Is there the ability to set the default STEP for a field that has not been used as an aggregate but is in the list for the user to select? We have an AGE field, and when the user drags it to either the ROW or COLUMN, the default STEP is 100. We need it to default to 10. Can we do this programmatically?

 

TIA.

2 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 22 May 2024, 11:23 AM

Hello, Mark,

Yes, it is possible to define the step value for DoubleGroupDescription by setting the Step property. It would be necessary to specify the PropertyName to point to your age field. You can do this in the following way:

DoubleGroupDescription unitPriceDescriptor = new DoubleGroupDescription() { PropertyName = "UnitPrice", Step = 10, GroupComparer = new GroupNameComparer() };
dataProvider.RowGroupDescriptions.Add(unitPriceDescriptor);

For more additional information you can check the following article: Using the LocalSourceDataProvider - RadPivotGrid - Telerik UI for WinForms

I hope this information is useful. If you have any other questions do not hesitate to ask.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Mark
Top achievements
Rank 2
Bronze
Bronze
Veteran
commented on 28 May 2024, 02:28 PM

In the code example above, it looks like you are adding the "UNITPRICE" programmatically to the ROW GROUP, which you are correct, we can do that. But we have a default set of ROWS/COLUMNS/AGGREGATES when the grid is displayed.  What we are experiencing is when the user drags the "AGE" field to the COLUMN or ROW, the default STEP is 100. Is there any way to change this default from 100 to 10 when the user drags that column into the COLUMN/ROW?

 

0
Nadya | Tech Support Engineer
Telerik team
answered on 31 May 2024, 07:48 AM

Hello, Mark,

Thank you for providing clarifications.

To define the step when the user drags a column into column/row fields you can use the PrepareDescriptionForField event in the following way:

private void DataProvider_PrepareDescriptionForField(object sender, PrepareDescriptionForFieldEventArgs e)
{
    var description = e.Description as DoubleGroupDescription;
    if (description != null && description.PropertyName == "UnitPrice")
    {
        description.Step = 10;

    }
}

I hope this helps. If you have any other questions do not hesitate to ask.

Regards,
Nadya | Tech Support Engineer
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com
Tags
PivotGrid and PivotFieldList
Asked by
Mark
Top achievements
Rank 2
Bronze
Bronze
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or