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
185
How to add a row ABOVE the column headers
posted

I want to add a row above the coloumn headers to achieve something like this:

 

 heading1 | Heading 2 | Heading 3 |

col1 | col2 | col3 | col4 | col5 | col 6 |

 

I tried creating a new UltraGridRow and adding UltraGridCell with the same colspan count as the number of columns. 

UltraGridRow ugr = new UltraGridRow();
UltraGridCell ugcell = new UltraGridCell();

            for (int i = 0; i <= groupCount; i++)
            {
                ugcell = new UltraGridCell();
                ugcell.Style.HorizontalAlign = HorizontalAlign.Center;
                ugcell.ColSpan = 2;
                ugcell.Text = "test";
                ugcell.Style.ForeColor = System.Drawing.ColorTranslator.FromHtml("#304E74");
                ugcell.Style.VerticalAlign = VerticalAlign.Top;
            }

UltraWebGrid1.Rows.Add(ugr);

 

Do I need to do this at a particular event?

I was able to do this with a standard gridview in the rowcreated event by doing

gvw1.Controls[0].Controls.AddAt(1, gvr);

 

Thanks in advance for any help you can give me.