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.
The measure that is added in "EditableMeasures" collection have to be added in pivot grid, so that only cell containing data from this measure are editable. If measure/measures added in "EditableMeasures" collection are not added in pivot grid no cell can be edit.
Nevermind when measure is added in pivot grid - before or after cell editing settings are set.
You don't have to add columns in pivot column header or make some refresh. Just set edit setting and add the measure that is in "EditableMeasures" in pivot grid. Or add measure in pivot grid, set edit setting like add selected measure in pivot to "EditableMeasures" collection and so on. There is one cell that have to be editable.
If you have again this issue can you provide me simple project or just steps to follow?
Regards
Thanks Mircho.
I just checked out the silverlight website and got mycell editing working.
I have one more question though. I can't seem to get the Measures initialized as following as List<IMeasure> or List<IMeasureViewModel>:
DataSourceBase.GenerateInitialItems("Effective Bid");
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>.
Thanks for your reply Mircho.
So how can I get this Initial list of Measures?
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
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.