.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> .NET Framework >> Post New QuestionBookmark and Share Subscribe to Forum

GridView Row Updation

Posted By: Dhilip.R     Posted Date: November 26, 2010    Points:2   Category :.NET Framework
Hi friends,

Can anybody tell me how to update row in gridview. I tried the following code

protected void gvstudent_SelectedRowUpdating(object sender, GridViewUpdateEventArgs e)
{
#region GridView Row Updating
_name = ((TextBox)gvstudent.Rows[e.RowIndex].Cells[1].FindControl("txtname")).Text;
_fees = ((TextBox)gvstudent.Rows[e.RowIndex].Cells[2].FindControl("txtfees")).Text;
_rollno = txtrollnoinsert.Text;
repeter.updatestudent(_name, _fees, _rollno);
gvstudent.EditIndex = -1;
gridviewload();
clear();
#endregion
}

But the following line are giving me the old value,how to get the new value, _name = ((TextBox)gvstudent.Rows[e.RowIndex].Cells[1].FindControl("txtname")).Text;
_fees = ((TextBox)gvstudent.Rows[e.RowIndex].Cells[2].FindControl("txtfees")).Text;

Responses
Author: Sajid P K             
Posted Date: November 29, 2010     Points: 5   

Dhilip,

can you please post you grid view aspx Code ?

or try

_fees = e.newvalues["DbFiledforFeeshere"].ToString()



Regards,
Sajid P k





Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend