Add a Blank row in a datagrid without using dataset
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
I want to insert blank row to datarid without using dataset on the specify itemindex of datagrid plzzz help me thanx in advance aj
-
I want to insert blank row to datarid without using dataset on the specify itemindex of datagrid plzzz help me thanx in advance aj
Try the following codes (assume that there has 2 columns id and name in your datagrip) Dim dt As DataTable = New DataTable Dim dr As DataRow ' Add the columns as defined in the datagrip dt.Columns.Add("id") dt.Columns.Add("name") dr = dt.NewRow ' Set the value in dr if necessary ' dr("id") = 1 ' dr("name") = "My Name" ' dt.Rows.Add(dr) Me.DataGrid1.DataSource = dt Me.DataGrid1.DataBind() (I'm new to asp.net also, there may have some other simple option.....)