I created a custom data grid, with custom table styles et al.
I am exposing a event handling delegate as a property, so that the users may hook their own functions to add on to the paint methods.
The Property does show up in the property page, however it wont allow me to add anything there.
What I am basically asking is, How do I expose a delegate in the property page of a custom control?
ADAdministrator Syncfusion Team May 2, 2003 09:32 AM
i hope this is what you are asking
public event EventHandler SelectedIndexChange;
protected virtual void OnSelectedIndexChange(EventArgs e)
if (SelectedIndexChange != null)
// Invokes the delegates.
and whereever you want to fire the event you put
SASameerMay 9, 2003 09:10 AM
No, I will try explaining the problem again, maybe i am not sure what i really want ( that is always dangerous )
I have a custom control, which is a data grid. I have a delegate defined within the control, and i want the users to hook their own functions there.
From ur example, when we have a combo box, and we need to handle some events, like the selected change, in the property sheet u would look up the event selected index changed and add ur own function there.
Similarly I am exposing an event called CellPaint, and I need the user to add their own function.
When I expose the delegate from within my control as a public property, it appears on the property sheet, but is uneditable.
I am sorry if i am not too clear abt my question. i am still a newbie and pretty much learning the C# lingo
thanks for your answer tough.
> i hope this is what you are asking
> [Category("Property Changed")]
> public event EventHandler SelectedIndexChange;
> protected virtual void OnSelectedIndexChange(EventArgs e)
> if (SelectedIndexChange != null)
> // Invokes the delegates.
> SelectedIndexChange(this, e);
> and whereever you want to fire the event you put
> this.OnSelectedIndexChange(new EventArgs());