I wasted lot of time in the internet to search on this topic. But still I couldn't understand how to do it. Can anyone give me code snippets of the view model and the Xaml? It would be better if anyone can give me a sample project.
This is a problem for me as well.
we are currently evaluating the Infragistics Pivot control but it's not MVVM friendly at all.
Can you help us by giving an example that uses the pivot control bound to a collection on a ViewModel?
We really like the ability to do cell editing though. so, it's a shame that we cannot use the your controls.
Thanks,
Suneth
This is an issue for me as well. Instead of having to rely on a declared resource such as a ViewModel (with or without parameters in the constructor, if that is even possible), it would be better to be able to bind the ItemsSource to any property within the DataContext (ViewModel).
The will work... but only when the default (parameterless) constructor is used for the ViewModel; for example, during design-time. This is not how the ViewModel is instantiated during run-time in my app:
<vm:MainViewModel x:Key="MainViewModel" />
<olap:FlatDataConnectionSettings x:Key="FlatDataConnectionSettings" ItemsSource="{Binding Source={StaticResource MainViewModel}, Path=TradeList}"/>
Something like this would be ideal:
<olap:FlatDataConnectionSettings x:Key="FlatDataConnectionSettings" ItemsSource="{Binding TradeList}"/>
Why is it that the DataSource for XamDataGrid is a DependencyProperty, while DataSource for XamPivotGrid is not?
Cheers,
--Vince
Hi,
You example is great. However, in my case (and most of the times) the viewmodel does not have a parameterless constructor.
The below line in the example is the problem:
<vm:FlatDataSourceViewModel x:Key="FlatDataSourceViewModel"/>
Could you please provide an example for a viewmodel that has multiple parameters ?
Thanks
Amit Kamat
Hello Haritha,
I am just checking if you require any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thank you for your reply. I have been looking into your requirements and regarding the editing of the cells of the XamPivotGrid, I can suggest referring to following article of our documentation, where the editing of the XamPivotGrid is described: http://help.infragistics.com/NetAdvantage/WPF/current/CLR4.0/?page=xamPivotGrid_EditingDataCells.html. Also you can find an example of editing of the XamPivotGrid in our Samples Browser, under xamPivotGrid->Editing and Selection->Cell Editing.
Regarding the items adding to the XamPivotGrid, I can suggest creating an add new item form and using it to add items to the source of the FlatDataSource. I have modified the sample application that I have provided you with, in order to show how you can implement this approach.
Currently, the XamPivotGrid, does not expose property that will allows you to get or set the selected row. You can use the ActiveCell property of the XamPivotGrid, in order to get the currently active cell in your view model. I have submitted a new Product Idea for you, for having such property. . I have sent your Product Idea directly to our product management team. Our product team chooses new Product Ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your idea is chosen for development, you will be notified at that time. Your reference number for this Product Idea is PI13040091
If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email. Please include the reference number of your Product Idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Thank you for your request.