Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
210
Special Grid header with grouped data
posted

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! 

Parents
No Data
Reply
  • 3627
    posted

    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.

Children