AD
Administrator
Syncfusion Team
May 2, 2003 02:32 PM UTC
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());
SA
Sameer
May 9, 2003 02:10 PM UTC
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.
-S
> 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());
>