2.0 GridView Updates question.

Discussion in 'ASP .Net Datagrid Control' started by mravichandran@gmail.com, Apr 19, 2006.

  1. Guest

    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.
    , Apr 19, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick
    Replies:
    0
    Views:
    351
  2. Tomasz Jastrzebski
    Replies:
    4
    Views:
    3,751
    Walter Wang [MSFT]
    Dec 8, 2006
  3. McGeeky

    Batch updates with GridView

    McGeeky, May 9, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    569
  4. Andy B
    Replies:
    0
    Views:
    600
    Andy B
    Aug 5, 2008
  5. Nick
    Replies:
    8
    Views:
    739
Loading...

Share This Page