Question : How to add empty rows to a databound GridView?

For display formatting reasons I need to add some empty rows to a GridView which is bound to a database table. Is there a way of doing this?

The GridView is for display only, I don't need to be able to insert new data into the database table or edit rows.

Answer : How to add empty rows to a databound GridView?

How about something like this...

Dim DT as Datatable = FunctionToGetDatatable() '<=Get your datatable from the database
Dim emptyRows as Integer = 5 '<=Number of empty rows
While emptyRows > 0
     Dim newRow as DataRow = DT.NewRow()
     DT.Rows.Add(newRow)
     emptyRows -= 1
End While
GridView1.Datasource = DT
GridView.Databind()
Random Solutions  
 
programming4us programming4us