I have a XamDataGrid with table data giving a master detail relationship.
Master (Particle):
Fields: Name, Retention Time, Signals => detail
Detail (Signal):
Fields: Integral, Volume, Concentration…
Now the field integral can have different units thus the header must vary accordingly. As the signals are loaded dynamically and even the user can specify his own type of signals, the header label needs to be created on the fly for each record differently.
How can this be done?
Hello Horst,
In order to access child layout/fields you have to use line 80 and index into another sub layout and change the Label.
eg.this.xgrdCaseByWellSummary.FieldLayouts[1].Fields["LastNameWithEmailID"].Label
In my example I am also setting the DataSource property in Xaml. How and when do you want to bind your grid?
Yes, that is what I said even in my first post.
I also prefer to set the DataSource oft the DataPresenter than the DataContext.
regards Horst
Do you mean child fields in a hierarchy?
This example only works for the top level of the data structure but not for a detail dataset.
How can the "DataItem" of the detail set be accessed from the field properties?
You can try using a LabelPresenterStyle. I attached an example below. Let me know if you have any questions.
XamDataGridLabelBinding.zip