G
Guest
Hi,
My datagrid reads and loades from a database 'select statement' fine. Then
after I have all rows on the screen, I want to be able to add a new row via a
button press. AFter that I would like to pupulate this new row with data
coming from the datbase again (via a dataset)
Does anyone know how to add a new row to a datagrid? I use the following
command:
short newIndex = (short) dataGrid1.Items.Count; //
dataGrid1.Items[newIndex].DataItem = new
System.Web.UI.WebControls.DataGridItem(1, 0, ListItemType.Item);
1 is the index of the new row(it should actually be the value of newIndex
but I=it gives me an out of range error!. The second paramter is the
datasetindex for data row# that comes from database, I don't know what to put
for this one.
Thanks a lot
My datagrid reads and loades from a database 'select statement' fine. Then
after I have all rows on the screen, I want to be able to add a new row via a
button press. AFter that I would like to pupulate this new row with data
coming from the datbase again (via a dataset)
Does anyone know how to add a new row to a datagrid? I use the following
command:
short newIndex = (short) dataGrid1.Items.Count; //
dataGrid1.Items[newIndex].DataItem = new
System.Web.UI.WebControls.DataGridItem(1, 0, ListItemType.Item);
1 is the index of the new row(it should actually be the value of newIndex
but I=it gives me an out of range error!. The second paramter is the
datasetindex for data row# that comes from database, I don't know what to put
for this one.
Thanks a lot