2.0 GridView Updates question.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top