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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

deleting a selected record

Thread ID:





53460 Dec 14,2006 12:19 AM UTC Dec 15,2006 08:46 PM UTC WinForms 4
Tags: GridControl
Ossama Alami
Asked On December 14, 2006 12:19 AM UTC


If I have a selected record which is then deleted from the list the gridgroupingcontrol does not seem to raise a selectedrecordchanged event, which I would expect it would.

In either case, I need to be able to handle this event in some fashion, and I tried looking around and handling RecordDeleted to check if that record was selected, but RecordDeleted never seems to be called.

Am I missing something?

Administrator [Syncfusion]
Replied On December 14, 2006 06:00 AM UTC

Hi Ossama,

By default, the GridGroupingControl have two type of selection modes (http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=344). i.e., record based selection and cell based selection. The SelectedRecordChanged event only fires in record based selection mode. If you want to detect the selection changes in the cell based selection mode, you need to handle the TableModel.SelectionChanging event.

Do you want to cancel the default record deletion? If so, you can set the TableDescriptor.AllowRemove property to FALSE.

Kindly try it and let us know if you need any further assistance.

Best regards,

Ossama Alami
Replied On December 14, 2006 05:09 PM UTC

I am in the record-based selection mode. The problem is that when a selected record is removed from the underlying binding list I don't get a selectedrecordchanged event, so I have no way of knowing if selection has changed. I use selection in this grid to drive another part of the application, so I need to know when it has changed.

Jayakumar Natarajan [Syncfusion]
Replied On December 14, 2006 11:54 PM UTC

Hi Ossama,
Grid.SourceListRecordChanging / SourceListRecordChanged events are raised when the records are removed from the underlying list. The selection events are disabled when the records are removed and cleared. You can make use of the SourceListListChanged event to detect if the record to be revmoved is selected:

void gridGroupingControl1_SourceListListChanged(object sender, Syncfusion.Grouping.TableListChangedEventArgs e)

if (e.ListChangedType == ListChangedType.ItemDeleted)
Console.WriteLine("Is the record selected? :" + this.gridGroupingControl1.Table.Records[e.NewIndex].IsSelected());

Best regards,

Administrator [Syncfusion]
Replied On December 15, 2006 08:46 PM UTC

Thanks very much, thats exactly what I needed.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon