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 and update command???

datagrid and update command???

Scheduled Pinned Locked Moved ASP.NET
questiondesigndockerannouncement
2 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.
  • M Offline
    M Offline
    Marix
    wrote on last edited by
    #1

    I have in my aspx application a small datagrid with column NAME: <%# DataBinder.Eval(Container, "DataItem.NAME") %> When I turn one of rows in datagrid in edit mode and change a NAME field I call updatecommand (ok), and it fires up an update event. In the code, I catch this event: private void dataGridVersija_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { Response.Write(((TextBox)e.Item.FindControl("txtNAME")).Text); this.dataGridVersija.EditItemIndex = -1; this.dataGridVersija.DataSource = this.DataView1; this.dataGridVersija.DataBind(); } I try to write the text that I changed, but all the time I get the old NAME (text). I cannot get these changes!! WHY? So how can I update datasource if I can not get changes I made? Thanx

    M 1 Reply Last reply
    0
    • M Marix

      I have in my aspx application a small datagrid with column NAME: <%# DataBinder.Eval(Container, "DataItem.NAME") %> When I turn one of rows in datagrid in edit mode and change a NAME field I call updatecommand (ok), and it fires up an update event. In the code, I catch this event: private void dataGridVersija_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { Response.Write(((TextBox)e.Item.FindControl("txtNAME")).Text); this.dataGridVersija.EditItemIndex = -1; this.dataGridVersija.DataSource = this.DataView1; this.dataGridVersija.DataBind(); } I try to write the text that I changed, but all the time I get the old NAME (text). I cannot get these changes!! WHY? So how can I update datasource if I can not get changes I made? Thanx

      M Offline
      M Offline
      Marix
      wrote on last edited by
      #2

      Something is missing in the top???? There must be written that I have a one templated column (ID="txtName"). Where edittemplate column is textbox.

      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