How to simulate ItemClick in the UltraExplorerBar

Posted by rbf on 18-Oct-2011 14:45

I have populated an UltraExplorerBar with Groups and Items.

Now the system needs to automatically open a certain Group and simulate ItemClick on a particular Item in that Group.

How do I do that?

All Replies

Posted by Admin on 18-Oct-2011 15:17

I'd select the group using the SelectedGroup property as this is important feedback to the user.

I would not simulate the item click - I'd rather call the same "worker method" from the actual event handler and your other routine.

Posted by rbf on 20-Oct-2011 13:02

And what is the .NET way to find the Item given the key so I can find the Group?

Posted by Peter Judge on 20-Oct-2011 13:27

rbf wrote:

And what is the .NET way to find the Item given the key so I can find the Group?

This works. You can also use an ordinal value .

message this-object this-object:GetClass():TypeName program-name(1) program-name(2) skip(2)

  uxAccordion:Groups:Item["Orders"]:Items["ListOrders"]:Key

  uxAccordion:Groups:Item["Orders"]:Items["ListOrders"]:Text

view-as alert-box error title '[PJ DEBUG]'.

-- peter

Posted by Admin on 20-Oct-2011 13:57

And what is the .NET way to find the Item given the key so I can find the Group?

oGroup = ultraExplorerBar1:GetItemByKey ("your key here"):Group .

/* Returns the first Infragistics.Win.UltraWinExplorerBar.UltraExplorerBarItem in the Infragistics.Win.UltraWinExplorerBar.UltraExplorerBar with the specified Key. */

Posted by rbf on 20-Oct-2011 14:01

Of course!

I had already forgotten. Thanks.

-peter

Posted by rbf on 20-Oct-2011 14:03

mikefe wrote:

I'd select the group using the SelectedGroup property as this is important feedback to the user.

I would not simulate the item click - I'd rather call the same "worker method" from the actual event handler and your other routine.

Just out of curiosity: if I still wanted to click the item, how could I do that?

Posted by Admin on 20-Oct-2011 14:07

Just out of curiosity: if I still wanted to click the item, how could I do that?

I don't know - maybe use a SendMessageA Windows API to simulate a mouse click by sending the Control the proper message?

Or inherit from the UltraExplorerBar class so that you can call the PROTECTED method OnItemClick. I'd probably go for the latter.

Posted by rbf on 20-Oct-2011 14:23

Sounds like that is not the way to go then.

This thread is closed