Hi,
Is there any way to make the Pivot Grid editable. That is allow user to change the cell values by typing into it. And also how can these be committed to the underlying FlatDataSource.
Thanks
Sangeetha
Yes, there is a way to make pivot grid editable.
First you have to allow cell editing - set "AllowCellEdit" property to true. "AllowCellEdit" property is in pivot grid "EditSettings" property. Second you have to mention which measures you want to edit - add a measure in "EditableMeasures" collection. "EditableMeasures" collection is in pivot grid "EditSettings" property. When you edit a cell two events are fired - CellEditing and CellEdited. The third thing is to catch these events and in their event handlers to implement your own logic. The control does not support the functionality automatically to update the source data. You can see how is implemented our sample with FlatData.
http://samples.infragistics.com/sldv/RunSamples.aspx?cn=pivot-grid#/pivot-grid/cell-editing
Hope that this will help you.
Regards,
Mircho Yovchev
Thank You for your reply Mircho.
I set "AllowCellEdit" property to true, and added a measure to "EditableMeasures" collection.
i invoke it via menu Item 'Allow Cell Edit'. Why are the cells not editable until I drag/drop a col from pivot data selector.
Seems like a refresh issue, but refresh does not seem to work either.
Could you please tell me what is the problem here.
It is working great now. Thanks a lot.
Thank You Mircho.
Now all editable measures are in the list. But there still is this problem when. when I right click and invoke ''Allow Edit cell" which sets the equivalent property of the PivotGrid, the existing Measure is not editable although it is in EditableMeasures. However when I select/Drag/Drop a Measure form the selectro to the grid, it becomes editable.
You can get measures from datasource like this:
IMeasure measure = dataSource.Cube.Measures[index] and from this measure you can create IMeasureViewModel mvm = dataSource.CreateMeasureViewModel(measure)
dataSource - your data source object
Thanks for your reply Mircho.
So how can I get this Initial list of Measures?
When you call GeneratInitialItems method string parameters are only filled in a string collection, according to which initial data will be loaded once you have the metadata loaded. But in the moment this method is called there is no metadata loaded. That's why GeneralInitialItems method do not return List<IMeasure> or List<IMeasureViewModel>.