Hi i nedd to update a datatable binded in a gridview here is the code:

protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        ds.Tables[0].Rows[e.RowIndex]["n1"] = Convert.ToInt32(((TextBox)(this.GridView1.Rows[e.RowIndex].Cells[3].Controls[0])).Text);
        GridView1.EditIndex = -1;
        GridView1.DataSource = ds.Tables[0];

The problem is that when i change a value in the cell 3 and i click update it returns to the initial value, it doesent update the cell in the datatable.. thanks

Have you tried the GridView.UpdateRow Method("Use the UpdateRow method to programmatically update the record at the specified index in the data source.")? The MSDN article is here