I have a serious problem with customzing a XamDataGrid. I display hierarchical data within a gri, say three levels.
What I want the grid to have, is a single header at the very top that shows the columns of the third level. It is essential that the header is shown at the top of the grid, rather than at the top of each nested group.
I attached a picture that demonstrates what I want to achieve.
Any help is appreciated!
I believe you're trying to do somethig similar to what I'm doing. You would do three things:
1. Hide the Labels that would normally be above the columns.
<igDP:FieldLayout.Settings>
<igDP:FieldLayoutSettings LabelLocation="Hidden" />
</igDP:FieldLayout.Settings>
<igDP:FieldLayout.Fields>
2. Create an event handler for xxx
InitializeRecord="XamDataGridDetails_InitializeRecord"
3. In the new event handler, override the GroupByRecord's Description property with a formatted string.
private void XamDataGridDetails_InitializeRecord(object sender, Infragistics.Windows.DataPresenter.Events.InitializeRecordEventArgs e){ if (e.Record != null) { GroupByRecord gbr = e.Record as GroupByRecord; if (gbr != null) { if (gbr.Value != null) gbr.Description = string.Format(" {30,0} Soll Ist", gbr.Value.ToString()); else gbr.Description = "NULL"; } }}
The catch is that I suspect you may struggle with aligning the labels over the columns, since columns can be resized and thus moved.
Hi tbeulieu,
Thanks for your answer. This is an interesting idea you have there. It isn't exactly what I was looking for, but I will investigate your suggestion and will see how far I can get.
Perhaps there are still some other hints out there. Keep 'em coming.