2.0 GridView selected row question...
-
Hi all! Heres my problem - i have a gridview bound (via sqldatasource) to a simple table... The table consists of 2 columns, an ID column (auto increment primary key) and a NText column... On the webpage im displaying the gridview and a simple button. When the user clicks the button a new row is created and inserted... For testing purposes, the NText field just contains a random GUID. The gridview is then rebound and it appears in the list, great, that works fine..... however, when the user clicks the "add random" button i want the row they just created to be selected!!... so far i've got the ID of the last inserted using the Insert Indentity methodology and returning the ID field. The problem is dont seem to be able to set the SelectedKey or SelectedValue on the datagrid, all i can change is the index!! What am i missing here?? Cheers! Will
-
Hi all! Heres my problem - i have a gridview bound (via sqldatasource) to a simple table... The table consists of 2 columns, an ID column (auto increment primary key) and a NText column... On the webpage im displaying the gridview and a simple button. When the user clicks the button a new row is created and inserted... For testing purposes, the NText field just contains a random GUID. The gridview is then rebound and it appears in the list, great, that works fine..... however, when the user clicks the "add random" button i want the row they just created to be selected!!... so far i've got the ID of the last inserted using the Insert Indentity methodology and returning the ID field. The problem is dont seem to be able to set the SelectedKey or SelectedValue on the datagrid, all i can change is the index!! What am i missing here?? Cheers! Will