Hi,
Is it possible to show a hierarchical data(another grid) on clicking of a row in a igDP:XamDataGrid?
regards
Vivek
Hello Vivek,
Thank you for your post. I have been looking through it and I attached a sample project containing a xamDataGrid with hierarchical data. By selecting a row, the child elements are expanded. Please let me know if this covers your expectations.
I am looking forward to see hearing from you.
Hi Stefan Stoyanov
Great example. That was really helpful to me!
I do have one question though. Is it possible to remove the headers from the "book-items". I have some "recursive" data that I want to display with the same headers for all rows.
Is this possible and if so, how?
I wasn't able to use x:Key="master", only Key="master". I get the following exception when I try to build.
'Initialization of 'Infragistics.Windows.DataPresenter.XamDataGrid' threw an exception.' Line number '34' and line position '14'.
The exception refers to the first instance of <igDP:XamDataGrid.FieldLayouts>.
<igDP:XamDataGrid x:Name="MyGrid" DataSource="{Binding Calculations}" AssigningFieldLayoutToItem="MyGrid_AssigningFieldLayoutToItem"> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings CellClickAction="SelectRecord" AllowEdit="True" /> </igDP:XamDataGrid.FieldSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout Key="master"> <igDP:Field Name="ShortName"></igDP:Field> <igDP:Field Name="Name"></igDP:Field> <igDP:Field Name="Min"></igDP:Field> <igDP:Field Name="Prob"></igDP:Field> <igDP:Field Name="Max"></igDP:Field> <igDP:Field Name="Mean"></igDP:Field> </igDP:FieldLayout> <igDP:FieldLayout Key="nested"> <igDP:Field Name="ShortName"> <igDP:Field.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource MyStyle}"></igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Name"> <igDP:Field.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource MyStyle}"></igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Min"> <igDP:Field.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource MyStyle}"></igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Prob"> <igDP:Field.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource MyStyle}"></igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Max"> <igDP:Field.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource MyStyle}"></igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Mean"> <igDP:Field.Settings> <igDP:FieldSettings LabelPresenterStyle="{StaticResource MyStyle}"></igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
Hello again,
It seems like I am missing something. Would you please send me an isolated sample project, so I will be able to investigate your issue further.
Looking forward for your reply.
Hi Stefan
I actually got the XamDataGrid working with the XAML from my previous post, I just had to simplify the code-behind. I do have a couple of questions though...
Is it possible to remove the indentation, so all the "sub-columns" align with the top-level?
I would also like to know if it is possible to bind the XamDataGrid to an MVVM model instead of using the <Grid.DataContext> XAML-tag?
I would like to be able to set the DataContext of the MainWindow-class to an instance of a class (vmMain) that exposes an ObservableCollection...
Hello Christian,
I attached a sample project showing the functionalities that you are looking for. Please let me know if this meets all your requirements or you need further assistance on this matter.
That worked great!
As I use my own class in the binding collection I need to get the selected item in order to add "sub-items". Which property on the XamDataGrid should I bind to? I noticed the ActiveRecord-property, but it returns a Record-object.. What should I do?
When you buy a license you get both the WPF3 and WPF4 assemblies, so I assume you are looking for ver.4 in C:\Windows\assembly, where is the GAC for CLR 1, 2 and 3 and the GAC for CLR 4 is here C:\Windows\Microsoft.NET\assembly\GAC_MSIL. Please let me know if this helps you or you need further clarifications on this matter.
It seems to be working alright for now...
But, I am still wondering why I only have WPF3-assemblies, when all the code you have send me uses WPF4-assemblies?
Do I only get the WPF4-assemblies when my company buys a license?
I should have the latest version (2011.1) installed...
Hello,
I am glad I helped you resolve your issue. Could you please verify this thread as answered so that other community users may benefit from it as well.
Thank you in advance.
Hello Stefan
That worked perfectly in my project.
Thank you very much!
I have been looking through your sample and I modified it, so that there isn’t any indentation. Basically I used a converter to set the DataRecordPresenter margin property depending on the records level. Please let me know if this satisfies your requirements or you need further help.