Basic question - How do I register for event?

Need to register for data changed event of the grid. Essentially, if data in a grid cell changes, I need to be notified.

So I think I need:

this.theGrid.DataChanged += new XXX(myDelegateMethod);

But what is XXX?

Also, what should the signature of myDelegateMethod look like.

Appreciate any help!!

1 Reply

HA haneefm Syncfusion Team May 25, 2007 09:08 PM UTC

Hi York,

What is XXXX?
>>>>>>

XXXXX is a EventHandler delegate class. Below is a code snippet.

this.gridControl1.DataChanged +=new EventHandler(gridControl1_DataChanged);

private void gridControl1_DataChanged(object sender, EventArgs e)
{ Console.WriteLine("DataChanged Event"); }

But you can try handling the CellsChanged event to detect cell changes in a grid. Please try the suggestion and let me know if this helps.

this.gridControl1.CellsChanged +=new GridCellsChangedEventHandler(gridControl1_CellsChanged);
private void gridControl1_CellsChanged(object sender, GridCellsChangedEventArgs e)
{ Console.WriteLine("CellsChanged Event"); }

Best regards,
Haneef

Loader.
Up arrow icon