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. Image for the cookie policy date
close icon

Vinz: How to trigger the GridgroupingControl Deleting Event using other Component ?

Hi, Is there any way to trigger the GridGroupingControl Events (eg _RecordDeleting)in another Component/Object(eg Button) Event (eg _Click)? Currently, I want to delete a record in the GridgroupingControl by allowing user to select a record and then click on a button to delete the record. Can anyone tell how to do it? I tried to used a single Event function to handle 2 Events (Button_Click & GridGroupingControl_RecordDeleting) but it prompted me that both events doen''t have the same signature. Please advice...thanks :) Best Regards Vinz

5 Replies

AD Administrator Syncfusion Team November 4, 2004 11:09 AM UTC

Raising the RecordDeleting event does not actually delete a record. The action of deleting the record is what raises the event. To delete a record, try using this.gridGroupingControl1.Table.DeleteRecord. It is in the code for this method that RecordDeleting is raised. The DeleteRecord method check the event args passed into the event to see whether or not it should actually delete the record, giving the listeners to the event the option of controlling whether the record gets deleted or not. But the event itself does not actually delete anything.


VL Vincent Loy Chee Hoon November 4, 2004 11:25 PM UTC

Thanks Clay :), but a question here.. does this.gridGroupingControl1.Table.DeleteRecord method actually deletes the record in it referenced datasource and update the actual database itself ?? >Raising the RecordDeleting event does not actually delete a record. The action of deleting the record is what raises the event. > >To delete a record, try using this.gridGroupingControl1.Table.DeleteRecord. It is in the code for this method that RecordDeleting is raised. The DeleteRecord method check the event args passed into the event to see whether or not it should actually delete the record, giving the listeners to the event the option of controlling whether the record gets deleted or not. But the event itself does not actually delete anything.


VL Vincent Loy Chee Hoon November 4, 2004 11:37 PM UTC

hi Clay, I realised I need to pass in a parameter of a type called Syncfusion.Grouping.Record into this.gridGroupingControl1.Table.DeleteRecord(). So which property or method in GridGroupingControl will return such type? or Are there other alternatives which I can capture this information? Appreciate for advices, thanks ;) >Raising the RecordDeleting event does not actually delete a record. The action of deleting the record is what raises the event. > >To delete a record, try using this.gridGroupingControl1.Table.DeleteRecord. It is in the code for this method that RecordDeleting is raised. The DeleteRecord method check the event args passed into the event to see whether or not it should actually delete the record, giving the listeners to the event the option of controlling whether the record gets deleted or not. But the event itself does not actually delete anything.


VL Vincent Loy Chee Hoon November 4, 2004 11:37 PM UTC

hi Clay, I realised I need to pass in a parameter of a type called Syncfusion.Grouping.Record into this.gridGroupingControl1.Table.DeleteRecord(). So which property or method in GridGroupingControl will return such type? or Are there other alternatives which I can capture this information? Appreciate for advices, thanks ;) >Raising the RecordDeleting event does not actually delete a record. The action of deleting the record is what raises the event. > >To delete a record, try using this.gridGroupingControl1.Table.DeleteRecord. It is in the code for this method that RecordDeleting is raised. The DeleteRecord method check the event args passed into the event to see whether or not it should actually delete the record, giving the listeners to the event the option of controlling whether the record gets deleted or not. But the event itself does not actually delete anything.


AD Administrator Syncfusion Team November 5, 2004 07:22 AM UTC

What record do you want to delete? Try this.gridGroupingControl1.Table.CurrentRecord to get the current record.

Loader.
Live Chat Icon For mobile
Up arrow icon