This is a migrated thread and some comments may be shown as answers.

Editable Pivot

4 Answers 113 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 05 Feb 2018, 04:50 PM
The documentation tells how to make PivotGrid editable using the overrides of the EditProvider, but really doesn't show how to override.  Any chance there is an example of this working? 

4 Answers, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 07 Feb 2018, 11:27 AM
Hi Kevin,

Currently, we don't example which demonstrates creating a custom class which inherits EditProvider and overrides its methods. Basically, you can create a custom class which derives from EditProvider. Then you can set this custom class to the EditProvider of your RadPivotGrid.
public class CustomEditProvider : EditProvider
{
    // Overrides the desired methods here
}
public MainWindow()
{
    InitializeComponent();
    this.pivotGrid.EditProvider = new CustomEditProvider();
}

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Kevin
Top achievements
Rank 1
answered on 07 Feb 2018, 02:41 PM

Yea, I get that.  How about an example of the methods that need to be overridden, and example of what the code looks like to make the edit work?  For instance, I can override the EnableValidation and set to false, but I still get a validation error, so obviously I am missing something.  I am surprised that you guys introduced the new functionality and did not put example code out there that actually works, a video showing it working just doesn't help much.

 

Thanks,

Kevin

0
Kevin
Top achievements
Rank 1
answered on 11 Feb 2018, 09:36 PM

Dinko,

  Any chance you had time to put together, or found the code example for the edit functionality that can be shared?  I am hoping for a simple example that allows a value to be changed.  As of now , the edit ended never gets fired so I Cannot catch the change.  I just don't have a handle on what needs to be done in the overridden methods of the editprovider.  I am guessing that the PrepareEditor is where I am lacking.  Some guidance would be much appreciated.

Thanks,

Kevin


0
Dinko | Tech Support Engineer
Telerik team
answered on 12 Feb 2018, 01:56 PM
Hello Kevin,

Let me elaborate first that the new Editing functionality provides only a visual representation for the editing operation but the actual process should be handled entirely by the developer. Each cell in the RadPivot grid shows data. This data is in numeric format and is aggregated based on some description. For example, quantity of items sold in January. You have sold a different number of items on different days. So if you want to edit the quantity for this month it is up to you to decide on which day you sold more or less. 

To edit a value in a cell you can subscribe to the EditEnded of the RadPivotGrid and create custom logic for changing given value. I am attaching sample project which demonstrates a simple scenario how you can change a value in a cell. In the example, the logic works only for the Sum of Quantity row.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
PivotGrid
Asked by
Kevin
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Kevin
Top achievements
Rank 1
Share this question
or