DataGrid Added row

Results 1 to 2 of 2

Thread: DataGrid Added row

  1. #1
    Join Date
    Dec 1969

    Default DataGrid Added row

    I&#039;m using the datagrid to input info. I doing a search on the database and adding a row to the current DataSet. That works fine, but I&#039;m have problems get my primary key from the newly added row.<BR><BR>int Id = (int)DataGrid1.DataKeys[e.Item.ItemIndex] i have been using this line code. From what I see I can&#039;t get the id column because it a new row. How can I work around this problem?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: DataGrid Added row

    I used to get my Datagrid column ID as follows<BR>e As DataGridCommandEventArgs <BR>e.Item.Cells(0).Text <BR><BR>May be try reloading the page after the add.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts