Editing Items in DataGrid

Results 1 to 2 of 2

Thread: Editing Items in DataGrid

  1. #1
    Join Date
    Dec 1969

    Default Editing Items in DataGrid

    I&#039;m writing a datagrid where users can edit data from a column directly in the datagrid. Everything is working with one big exception. On the Update Command event, when I try to get the new value of the text box, it keeps returning the original value. How do I get the NEW value of the text box?<BR><BR>Here&#039;s what it looks like (its the txtNewRate that is giving me the original value instead of the new one):<BR><BR>public void dataGridEmployees_UpdateCommand(object sender, DataGridCommandEventArgs e)<BR>{<BR>object txtEmpID, txtNewRate;<BR>txtEmpID = this.dataGridEmployees.DataKeys[(int)e.Item.ItemIndex];<BR>txtNewRate = ((TextBox)e.Item.Cells[3].Controls[0]).Text;<BR><BR>......<BR>}

  2. #2

    Default RE: Editing Items in DataGrid

    Are you checking IsPostback before binding your list?<BR>

Posting Permissions

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