We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to Edit Cell in GridDataControl

Thread ID:

Created:

Updated:

Platform:

Replies:

96735 Oct 1,2010 10:11 AM Oct 12,2010 07:32 AM ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Hema Gunda
Asked On October 1, 2010 10:11 AM

Hi,

I just started using Syncfusion V8.2.0.18.

My usuage is to Use GridDataControl to bind to the Sql Datasource, Edit the Cell and Save it to the Database, Insert a new record and Save it to the Database.

I couldnt find any rowedit events.

How should I use the GridDataControl?

I appreciate your time and quick response.

Thanks.



Jeraldes J [Syncfusion]
Replied On October 12, 2010 07:32 AM

Hi Hema,

Thank you for your interest in Syncfusion products.

We would be glad to assist you on this query.

1.Edit Operation

The GridDataControl is bound to an Entity model the changes made in the Grid has to be updated to the Entity model by listening to the EndEdit event of the currency manager. The save will be handled automatically when the cell is out of edit mode.

[Code Snippet]

this.dataGrid.Model.CurrencyManager.OnEndEdit += ((s, e) =>
{
//Save handled
entity.SaveChanges();
});


2.Delete operation

The Delete operation can be triggered from the collection changed event as follows.

[Code Snippet]

this.dataGrid.Model.View.CollectionChanged += ((s, e) =>
{
//Delete handled
if (e.Action == NotifyCollectionChangedAction.Remove)
{
foreach (var item in e.OldItems)
{
entity.DeleteObject(item);
entity.SaveChanges();
}
}
});


Please refer the sample in the following location.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Databind_Entity-1826668124.zip


Sample Usage:
Change the field values or delete a record in the GridDataControl and click the "Load Data in SDK Grid" button to load the updated data to the SDK grid.

Let us know if this helps.

Regards,
Jeraldes J



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;