M
mravichandran
I have used the datagrid in ASP.NET 1.x (VS 2003) and i was very
pleased with the edit/update/ and delete features of the asp.net
datagrid.
now it is changed to 'gridview' and i am having a lot of difficulty.
when i change the values as text, it does not remember the new value,
it is still looking at the old values.
name of my gridview = gridProgram
protected void gridProgram_rowUpdating(object sender,
GridViewUpdateEventArgs e)
{
the old style did not work:
GridViewRow tempRow = gridProgram.Rows[e.RowIndex];
TextBox tempTextBox =
((System.Web.UI.WebControls.TextBox)(tempRow.FindControl("ID")));
DataControlFieldCell updateCell = gridProgram.Rows[e.RowIndex].Cells[2]
as DataControlFieldCell;
gridProgram.Columns[1].ExtractValuesFromCell(e.NewValues, updateCell,
DataControlRowState.Selected, true);
//also tried
//gridProgram.Columns[1].ExtractValuesFromCell(e.NewValues, updateCell,
DataControlRowState.Edit, true);
foreach (string strKeys in e.NewValues.Keys)
{
string strTestKeyValues = e.NewValues[strKeys].ToString();
}
right now, i should get only 1 value or 1 iteration and the
strTestKeyValues is remembering the old value as it came from the
database and not the changes i had made.
any idea will be greatly appreciated.
thanks and regards
Ravi Mahalingam
Fort Worth, TX.
pleased with the edit/update/ and delete features of the asp.net
datagrid.
now it is changed to 'gridview' and i am having a lot of difficulty.
when i change the values as text, it does not remember the new value,
it is still looking at the old values.
name of my gridview = gridProgram
protected void gridProgram_rowUpdating(object sender,
GridViewUpdateEventArgs e)
{
the old style did not work:
GridViewRow tempRow = gridProgram.Rows[e.RowIndex];
TextBox tempTextBox =
((System.Web.UI.WebControls.TextBox)(tempRow.FindControl("ID")));
DataControlFieldCell updateCell = gridProgram.Rows[e.RowIndex].Cells[2]
as DataControlFieldCell;
gridProgram.Columns[1].ExtractValuesFromCell(e.NewValues, updateCell,
DataControlRowState.Selected, true);
//also tried
//gridProgram.Columns[1].ExtractValuesFromCell(e.NewValues, updateCell,
DataControlRowState.Edit, true);
foreach (string strKeys in e.NewValues.Keys)
{
string strTestKeyValues = e.NewValues[strKeys].ToString();
}
right now, i should get only 1 value or 1 iteration and the
strTestKeyValues is remembering the old value as it came from the
database and not the changes i had made.
any idea will be greatly appreciated.
thanks and regards
Ravi Mahalingam
Fort Worth, TX.