Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AddNew w/ inline editing datagrid?
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
AddNew w/ inline editing datagrid?
Miscellaneous
Thread ID:
00855558
Message ID:
00855558
Views:
56
Trying to find some sample code that shows how to add a record associated with data grid inline editing.

I've done the edit, update, cancel, delete methods in the form's code behind, but the add part is eluding me. I've tried variations of the edit and updates, and I'm amazed that I get a new record, editable (including the default values) in the datagrid, but the save never seems to happen. Here's what I have right now, although I've been through a number of variations:
private void btnNewLink_Click(object sender, System.EventArgs e)
{
	// Retrieve the previous Links DataSet
	DataSet dsCompLinks = (DataSet)Session["dsCompLinks"];
	// add new row to data set with default values
	this.oCompLinks.NewRow(new LinkDefaultValues("1009", this.CompanyID));
	// Save the DataSet (the DataGrid automatically binds back)	
	this.oCompLinks.SaveDataSet(dsCompLinks);
	Session["dsCompLinks"] = dsCompLinks;
	// Reset the datagrid item index
	this.Mmdatagrid1.EditItemIndex = this.Mmdatagrid1.EditItemIndex + 1;
	// Rebind the DataGrid
	this.BindControl(this.Mmdatagrid1);
}
Any tips would be appreciated,
Chris.

chris jefferies
chris@freeranger.com
Next
Reply
Map
View

Click here to load this message in the networking platform