Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AddNew w/ inline editing datagrid?
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
AddNew w/ inline editing datagrid?
Divers
Thread ID:
00855558
Message ID:
00855558
Vues:
55
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform