How to add dynamic row in a grid

W

weecka

C# would be something like...

DataGridItem tRow = new DataGridItem(0, 0, ListitemType.Item);
TableCell c = new TableCell();
c.ColSpan = grid.Columns.Count; // if i want to add a header which
spans thru all of a row
c.Text = "New category";
tRow.Cells.Add(c);
(grid.Controls[0] as Table).Rows.AddAt(1, tRow);

The syntax may not be 100% correct. Use intellisence to find out what
these variables in DataGridItem constructor and AddAt are ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top