P
Prigozhin Roman
I'm trying to retreive data from DataGrid on my form and update dataset.
Problem is that it returns data without my changes.
((TextBox)e.Item.Cells[0].Controls[0]).Text; returns
unchanged values. Strange..
Here is where I'm calling it from :
private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string key=DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
DataSet1.EmployeesRow r;
r=DataSet1.Employees.FindByEmployeeID( Int32.Parse( key ) );
r.FirstName = ((TextBox)e.Item.Cells[0].Controls[0]).Text;
r.LastName = ((TextBox)e.Item.Cells[1].Controls[0]).Text;
sqlDataAdapter1.Update( DataSet1 );
sqlDataAdapter1.Fill( DataSet1);
DataGrid1.EditItemIndex=-1;
DataGrid1.DataBind();
}
Problem is that it returns data without my changes.
((TextBox)e.Item.Cells[0].Controls[0]).Text; returns
unchanged values. Strange..
Here is where I'm calling it from :
private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
string key=DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
DataSet1.EmployeesRow r;
r=DataSet1.Employees.FindByEmployeeID( Int32.Parse( key ) );
r.FirstName = ((TextBox)e.Item.Cells[0].Controls[0]).Text;
r.LastName = ((TextBox)e.Item.Cells[1].Controls[0]).Text;
sqlDataAdapter1.Update( DataSet1 );
sqlDataAdapter1.Fill( DataSet1);
DataGrid1.EditItemIndex=-1;
DataGrid1.DataBind();
}