Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. DataGrid Updating Event prob when AutoGenerateEditButton used...

DataGrid Updating Event prob when AutoGenerateEditButton used...

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorialannouncement
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Supriya Tonape
    wrote on last edited by
    #1

    Hi, I am stuck in a prob... I am editing the DataGrid where I have populated the data from DB. Now after editing the particular row I need to update it. I am able to edit but don’t know how to update it as ‘e’(GridViewUpdateEventArgs) is not giving me values...(protected void UpdatingRecord(object sender, GridViewUpdateEventArgs e)) I am copy pasting edit function (which is fine) and Update function which is not working. protected void EditRecord(object sender, GridViewEditEventArgs e) { BindData(); // here I am calling function which opens the DB connection n all... GridView1.EditIndex = e.NewEditIndex; GridView1.DataBind(); } Function not working or donno how to do... where ‘e’ is not giving values.. string 'str' is ‘null’ always... protected void UpdatingRecord(object sender, GridViewUpdateEventArgs e) { //GridView1.UpdateRow(e.RowIndex, true); //this stmt goes into recursion... GridViewRow row = GridView1.Rows[e.RowIndex]; string str = GridView1.Rows[e.RowIndex].Cells[1].Text; // for the time being hardcoded cell } I am getting 'str' as 'null'. Just tell me how to commit the row after editing it to update row coz just now while debugging I got to know that only the row which I am editing is returning ‘null’ but in watch window I changed the rowindex manually to diff row index to see if I am getting values and ‘e’ is showing all values for every column! regards, Supriya Tonape

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups