AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 How to take value from gridview in table gv_RowUpdating using XML
Posted by Jayamala D on  10/23/2007 11:56:08 PM Category: Asp.Net 2.0
Add to my favorites
Email to friend
Hi,
I am using xml.I want to take value from gridview in table using dataset.Her is the code(web application)
protected void gv_RowUpdating(object sender, GridViewUpdatedEventArgs e)
{
//get the new values from the gridview control
int i = gv.Rows(e.RowIndex).DataItemIndex();
TextBox strId =((TextBox)gv.Rows(e.RowIndex).Cells(2).Controls(0)).Text;
// Update the xml file using new values
DataSet ods = new DataSet();
gv.DataSource = ods;
ods.Tables[0].Rows[i].ItemArray[0] = strId;
ods.WriteXml("Information.xml");
Bindgrid();
}
am getting error that Row is a property but used like method,Does not contain RowIndex.

Post Your Reply Post New Question

 Viewer's Reply
Check this Code
Answered By Moderator1 on 11/2/2007 9:50:17 AM
There is some systax error in your code, Please check the below code, hope it will work

int i = gv.Rows(e.RowIndex).DataItemIndex;
TextBox strId =((TextBox)gv.Rows(e.RowIndex).Cells(2).Controls(0)).Text;

// Update the xml file using new values
DataSet ods = new DataSet();
ods=gv.DataSource;
ods.Tables[0].Rows[i].Item[0] = strId;
ods.WriteXml(Request.PhysicalApplicationPath + "Information.xml");
Bindgrid();
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
The PHP Anthology: 101 Essential Tips, Tricks & Hacks, 2nd Edition - Free 207 Page Preview!
Speech Technology Magazine
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview