israfel_e

israfel_e

  • NA
  • 14
  • 0

Edit Date within a Datagrid

Mar 31 2005 3:00 PM
I'm trying to edit records through a dynamically populated datagrid. The problem arises when i try to update a Date value in one of the cells. Does anyone know any good links, or is willing to explain how to deal with DateTime within a datagrid. For my Id field this works fine TableCell cell1 = (TableCell)e.Item.Controls[0]; string id = ((TextBox)cell1.Controls[0]).Text; My dateTime cells are on Controls[1], but every variation on the theme of the above ive tried to read the value ive changed, just deosnt work. Has anyone come up against this problem before and know how to get around it. I've tried variations along the lines of TableCell cell2 = (TableCell)e.Item.Controls[1]; DateTime myDate = ((TextBox)cell2.Controls[1]).Text.toString(); I just keep on hitting a wall. I can't update the records in the database unless i can do this. ANy help or advice appreciated.

Answers (7)