I pretty much have the functionality of my tree working as i want. There is a collection of items, and if the item has no children, it is to be considered a "Difference". If the "Difference" is checked, it is to be counted as "Accepted". This all seems to work, but i would like to make the tree layout like this:
1) The checkbox should be under the Accepted? column, and the Accepted and Differences counts should be under their respective column headers, and the name should text wrap if it gets beyond the name column width.
attached project sample...
i would also like to set IsEnabled on the checkbox itself depending on a property, IsEnabled, on the Item itself.
Hi Travis,
Thanks for your sample and the image of what you want to achieve. I want to review the sample in particular before I make my suggestions as to how to best achieve the look you want.
I'll get back to you tomorrow if I have any questions
Have you had a chance to review the updated sample? Please let me know if you have any questions or there is anything more I can help you with.
I'm returning your sample with a couple of changes. I set the AutoGeneratedFields back to False and added a key of Parent to the FieldLayout that was in the sample. I also added a second FieldLayout with a key of Child and set its LabelLocation to Hidden. You'll see that I also added the Fields to that layout as well, including Children, which you hadn't included but is necessary if you want to include the Children collection. Since you want to specify the fields in each layout, instead of relying on auto generation, you need to define the layout fields.
Then I added a XamDataGrid event AssigningFieldLayoutToItem, which will assign the records to a specific FieldLayout, Parent or Child. You can do this since all of the children have the same fields in the layout.
Have a look at the sample and let me know if you have any questions.
i have started trying to adapt my project to your xamDataGrid solution, but the code behind:
fl.Fields[cvp.Field.Index].Width = new FieldLength(e.NewSize.Width);
throws an error every time (Index out of bounds). If I comment out the XAML that uses it, i do see my fields etc, but I obviously need this for sizing no doubt.
Also, I need AutoGenerateFields="True" because the Item contains properties I don't want to display in the grid. However, when i set it to True, the Expansion Indicator disappears.
How can i fix these problems? I included my modified project so far. Thanks for your help!
I think you have some options here.
Using the XamDataTree you can add check boxes next to each node, which it looks like you’ve already figured out. And the XamDataTreeNode class includes a CheckBoxMemberPath which you have bound to the IsChecked field in your object.
These sites have some information concerning the xamDataTree and I believe the second link includes a sample.
http://help.infragistics.com/doc/WPF/2013.2/CLR4.0/?page=xamDataTree_xamDataTree_Check_Boxes.html
http://ko.infragistics.com/community/forums/p/80730/412643.aspx
And it also looks like you’ve figured out how to show multiple properties on each node by templating the itemTemplate of the NodeLayout.
But it won’t have the functionality of a grid layout, sorting, grouping, resizing columns, and lining up the columns at all the various node levels.
I think your best option is to use the xamDataGrid and your hierarchical data. You can hide the column headers of the child layouts and control the indentation so that the columns line up vertically.
I’m attaching a sample that demonstrates how to achieve the look you want with the XamDataGrid.
Please let me know if you have any questions.
thank you.