Retreiving data value within datagrid
Hi there,
Can anyone help me with a problem im having. I have a datagrid bound to a table with an id and datetime Date field. I want to be able to edit it, so ive added to edit colume and all that but the problem is i cannot read the date field no matter what i do. Perhaps im going down the complete wrong lane in my approach. I just can't get it working. Ive tried using
TableCell cell2 = (TableCell)e.Item.Controls[1];
DateTime myDate =convert.ToDateTime(((TextBox)cell2.Controls[1]).Text);
And ive tried reading the textbox as a string etc etc. does anyone know the proper way to read a date value from a textbox cell within a datagrid in order to edit that value and update. Any advice, links or code would be greatly appreciated - thanks
|