GianIsTheName
GianIsTheName

Reputation: 187

multi column headers on ultrawebgrid of Infragistics

I am currently using UltraWebGrid control of Infragistics to display data from an Oracle database. I was able to do this just right. Now I need to place a multi column header at the top of all the others column headers. I tried using the code below but when I checked it, it seems that the InitializeLayOut event is not triggered. Is there other way to do this? by the way I am using Visual Studio 2008, Oracle 11g and Infragistics v3.

protected void UltraWebGrid1_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
        {                        

            ColumnHeader colHead;
            for (int i = 0; i < e.Layout.Bands[0].HeaderLayout.Count; i++)
            {
                colHead = e.Layout.Bands[0].HeaderLayout[i] as ColumnHeader;
                colHead.RowLayoutColumnInfo.OriginY = 1;
            }


            ColumnHeader ch = new ColumnHeader(true);

            ch.Caption = "From Dispo";

            ch.RowLayoutColumnInfo.OriginX = 0;

            ch.RowLayoutColumnInfo.OriginY = 0;

            e.Layout.Bands[0].HeaderLayout.Add(ch);

            ch.RowLayoutColumnInfo.SpanX = 2;
        }

Thanks guys.

Upvotes: 1

Views: 1334

Answers (1)

alhalama
alhalama

Reputation: 3228

The InitializeLayout event should be triggered as part of data binding. If it isn't firing, you should verify that it is being wired up properly.

If you did want to test the logic outside of the event, e.Layout is equal to ultraWebGrid1.DisplayLayout so you could modify the code and put it in your page load event.

Upvotes: 1

Related Questions