Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Jeff Petter #1
Updating DataGrid while editing, doesn't update
I can't seem to get the update piece working properly while doing in-place editing. I don't receive any errors, but the update doesn't take place. From the examples I've used as "go bys" it looks pretty straight forward. I've included my update code below. If anyone has any insight into my problem, I would certainly appreciate it.
Thanks,
Jeff
private void DataGrid1_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
//load the dataset with the xml file
ds = new DataSet();
//load string with full path to xml file
string strFile = Server.MapPath(Request.ApplicationPath) + "\\exceptions.xml";
//load the dataset with the xml file
ds.ReadXml (strFile, XmlReadMode.InferSchema);
string strDate = ((TextBox)(e.Item.Cells[2].Controls[0])).Text;
string strException = ((TextBox)(e.Item.Cells[3].Controls[0])).Text;
string strDuration = ((TextBox)(e.Item.Cells[4].Controls[0])).Text;
//get current row
DataRow dr = ds.Tables["exceptions"].Rows[e.Item.ItemIndex];
dr["eDate"] = strDate;
dr["exception"] = strException;
dr["duration"] = strDuration;
ds.Tables["exceptions"].AcceptChanges();
ds.WriteXml (Server.MapPath(Request.ApplicationPath) + "\\exceptions.xml");
DataGrid1.EditItemIndex = -1;
BindDataGrid();
}
Jeff Petter Guest
-
MS Access UPDATE not updating with cfquery
Three columns will update (GolaCalls, GoalContacts, and GoalAppts). However, the two columns FirstName and LastName remain unchanged even if there... -
update query not updating
Hi I am trying to update via an datagrid only nothing seems to happen how would I diplay what the update query looks like msgbox reponse.write?... -
Update not updating :(
Hi guys, Still having problems with updating my mysql database records. I can now enter the data i want to update but, when I check the database... -
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible?
Hello, I am searching the whole Internet for a good example how to edit/update a DataGrid in a DataGrid (nested DataGrid). I know how to... -
Update Stats not updating for all the Tables
Hi All We are running Update statistics high for the whole database every night as a cron job, as our database is small of 1.5 GB. When i run...



Reply With Quote

