Add a new row on a datagrid

Hi I’m trying to create and add a new row on my datagrid. The type of this row is different from all the other rows on my datagrid. It’s like a new header. I already have a header. If there is a way to have multiple headers that would work too. when I try to add a new row inside the datagrid_ItemDataBound() method the first record on my datagrid was not shown.. any help ?
Who is Participating?
Although you can add many tables into one dataset, as far as I know its not possible to have multiple tables as the datasource for one datagrid..

You will need multiple datagrid.. Consider loading them at runtime maybe?
yellowflameAuthor Commented:
I don’t need to have multiple tables…
The headers of a datagrid represent the column names of the schema of the table which the datagrid represents, in order to have rows which follow a different schema would require a different table, but you cant show both tables in the same grid..

If that is what you were after..


Dim table1 as DataTable
Dim table2 as DataTable
Dim allData as DataSet

with table1
end with

with table2
end with



(code untested, so may not compile)

If however, you want to have another row of column headers that fit the same schema as the original data and also all the rows following the header fit the same schema, then you could just insert the header row as a normal row and then change the DefaultCellStyle on that row to make it look different from a normal cell..
yellowflameAuthor Commented:
i haven't try any of the above code because i don't want to have two datagrids.

thanks a lot for your comments
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.