Raise event in custom component
Posted
#1
(In Topic #894)
Regular

Clicking on a row in the gridview raises an event ('ChangeCat' in my project).
How to raise this event as soon as the control is loaded (i.e. with no further user action)?
Posted
Guru

Or your form_open
The control has not yet initialised in _new
Posted
Regular

This control draws 2 gridviews , a buttonbox etc all inside a Frame (hFrame) on the parent form so hFrame doesn't have a _Open or _Show event.
Have just tried hFrame_Activate() and hFrame_GotFocus() but these events aren't triggered.
Hope this makes sense.
Posted
Guru

Can't you simply call ChangeCat as the last command in _new()?
Posted
Regular

'Raise ChangeCat' in _new() doesn't work.
Thanks again
Posted
Guru

Ie..
just make sure the ChangeCat() sub uses direct links to the Control not the "Last" keyword
or in the Form_Open() explicitly set the gridview row
(or however you would set the grid item)
Posted
Guru

Posted
Regular

Putting the raise event in _Ready() doesn't work.
I've been running the event from the parent form but was trying to skip this step.
In the _new() sub, the table is filled with data and the first line is selected. At the moment gridview_Arrange() works fine.
Thanks again
1 guest and 0 members have just viewed this.


