gridview update
-
I used the following code for updating a record in gridview protected void gvcmem_RowUpdating(object sender, GridViewUpdateEventArgs e) { string sMemberID=gvcmem.DataKeys[e.RowIndex].Values["nMemberID"].ToString(); TextBox txtnumber=(TextBox)gvcmem.Rows[e.RowIndex].FindControl("txtnumber"); string sMemebername = gvcmem.DataKeys[e.RowIndex].Values["sMemberName"].ToString(); DataView dvUpdate = objGeneral.EditMemberPhoneNumber(sMemberID, sMemebername, string.Empty, txtnumber.Text, string.Empty, "1"); if (dvUpdate[0]["sStatus"].ToString() == "Success") { lblmess.Text = "Member Details Updated Sucessfully"; lblmess.Visible = true; } else { lblmess.Text = dvUpdate[0]["sStatus"].ToString(); lblmess.Visible = true; } gvcmem.EditIndex = -1; this.loadGrid(); } while updating when the text in the textbox is changed its not taking the updated text its taking the previous data itself nyone help pls
-
I used the following code for updating a record in gridview protected void gvcmem_RowUpdating(object sender, GridViewUpdateEventArgs e) { string sMemberID=gvcmem.DataKeys[e.RowIndex].Values["nMemberID"].ToString(); TextBox txtnumber=(TextBox)gvcmem.Rows[e.RowIndex].FindControl("txtnumber"); string sMemebername = gvcmem.DataKeys[e.RowIndex].Values["sMemberName"].ToString(); DataView dvUpdate = objGeneral.EditMemberPhoneNumber(sMemberID, sMemebername, string.Empty, txtnumber.Text, string.Empty, "1"); if (dvUpdate[0]["sStatus"].ToString() == "Success") { lblmess.Text = "Member Details Updated Sucessfully"; lblmess.Visible = true; } else { lblmess.Text = dvUpdate[0]["sStatus"].ToString(); lblmess.Visible = true; } gvcmem.EditIndex = -1; this.loadGrid(); } while updating when the text in the textbox is changed its not taking the updated text its taking the previous data itself nyone help pls
What happens when you step through in the debugger ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
What happens when you step through in the debugger ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
4anusha4 wrote:
the old text is coming in to the textbox but not the updated one
You may be binding the grid on
page_load
without checkingIsPostBack
.Navaneeth How to use google | Ask smart questions
-
4anusha4 wrote:
the old text is coming in to the textbox but not the updated one
You may be binding the grid on
page_load
without checkingIsPostBack
.Navaneeth How to use google | Ask smart questions
-
OK. Let me try again. What happens when you step through the debugger ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
OK. Let me try again. What happens when you step through the debugger ?
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
OK, so your datalayer call is being called with the values you expect, but they are not being updated in the database ? Then you need to look at your data layer code to work out why.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
I used the following code for updating a record in gridview protected void gvcmem_RowUpdating(object sender, GridViewUpdateEventArgs e) { string sMemberID=gvcmem.DataKeys[e.RowIndex].Values["nMemberID"].ToString(); TextBox txtnumber=(TextBox)gvcmem.Rows[e.RowIndex].FindControl("txtnumber"); string sMemebername = gvcmem.DataKeys[e.RowIndex].Values["sMemberName"].ToString(); DataView dvUpdate = objGeneral.EditMemberPhoneNumber(sMemberID, sMemebername, string.Empty, txtnumber.Text, string.Empty, "1"); if (dvUpdate[0]["sStatus"].ToString() == "Success") { lblmess.Text = "Member Details Updated Sucessfully"; lblmess.Visible = true; } else { lblmess.Text = dvUpdate[0]["sStatus"].ToString(); lblmess.Visible = true; } gvcmem.EditIndex = -1; this.loadGrid(); } while updating when the text in the textbox is changed its not taking the updated text its taking the previous data itself nyone help pls