Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Ribbon Tech Support » Ribbon commands Collapse All
Subject Author Date
Andrew Burrow Jul 1, 2008 - 9:38 AM

I am using a ribbon control to display controls via ribbon tabs and contextual ribbon tabs which are visible depending upon which child mdi form is currently in focus on the main body of the form.  Basic stuff.


I am using commands to link the buttons etc ...on the ribbon to methods on each of the child forms.  Still fairly basic.


What I am wanting to do though is update the ribbon controls to reflect what is on the selected child form.  This is demonstrated in the ribbon sample application which will highlight the Bold button if the select text in a window is bold. Now I can enable and disable buttons etc... easily but the sample application uses the command.data method to update the checked status of the Bold button.


Unfortunatly I don’t seem to be able to tell how this works in the sample application.


What I would like to do is have a combo box/textbox with the current search text for a list of results that is currently being displayed on the selected child form.  eg. Child form 1 has a list that is based on a search word ’apple’ and child form 2 has a list that is based on a seach word ’orange’.


When I flick between these two child forms I want the contents of the combobox/textbox on the ribbon to change to the search word.


Thanks for your help and hope I have been clear with my explanation.

Technical Support Jul 3, 2008 - 10:36 AM

If you want multiple combo-boxes to have the same item collection and to react to that collection changes, you can use the ComboBox.DataSource property to set the items.

As for the second problem, the commands on each form must differ, so you should manually set the commands for controls on each form in the form initializer (for instance, in the OnLoad() method). You can build a command name using form title as a unique constituent of the name(of cause if the form title differs for each instance).

Andrew Burrow Jul 2, 2008 - 10:09 AM

It is the command.data method that I want to use.  I can use this but am not sure how to specify what property of the associated control to change.


Eg. I have a combobox linked to a command.  I want to be able to alter the text property and the items property.  And anyother property for that matter, but specifically those.  Now if I do command.data = "some text" then it sets the combo box text property, which is fine.  But then I also want to do command.data = IList, of which IList is an enumerable list of combo items held in memory.


Now another point I have just come accross.


I have been messing around with commands the last couple of days and they seem great for what i am wanting to achieve.  But, if I have 2 forms that are derived from the same class (ie. have the same controls on them) but are displaying different sets of information, how do I stop the command.data setting the data on both forms.


Eg. I have a form with a list of clients on it and a textbox/combobox in the ribbon bar that is used to input search criteria.  I do a search that limits the results of the client list.  I also have another form open that is of the same class as the first foem but is displaying a different set of results in the client list.


If I type a search word on form 1, the text is reflected in form2.  Any way of seperating these 2 forms?


Again, I hope I am clear in what I am trying to explain and thanks in advance for any help that anyone may provide.

Technical Support Jul 2, 2008 - 8:30 AM

It seems you are would like to use Command.Data for your purposes. If so, please read this article about that. If it is not what you actually imply, please contact us again.

Andrew Burrow Jul 2, 2008 - 10:11 AM

It is the command.data method that I want to use.  I can use this but am not sure how to specify what property of the associated control to change.


 


Eg. I have a combobox linked to a command.  I want to be able to alter the text property and the items property.  And anyother property for that matter, but specifically those.  Now if I do command.data = "some text" then it sets the combo box text property, which is fine.  But then I also want to do command.data = IList, of which IList is an enumerable list of combo items held in memory.


 


Now another point I have just come accross.


 


I have been messing around with commands the last couple of days and they seem great for what i am wanting to achieve.  But, if I have 2 forms that are derived from the same class (ie. have the same controls on them) but are displaying different sets of information, how do I stop the command.data setting the data on both forms.


 


Eg. I have a form with a list of clients on it and a textbox/combobox in the ribbon bar that is used to input search criteria.  I do a search that limits the results of the client list.  I also have another form open that is of the same class as the first foem but is displaying a different set of results in the client list.


 


If I type a search word on form 1, the text is reflected in form2.  Any way of seperating these 2 forms?


 


Again, I hope I am clear in what I am trying to explain and thanks in advance for any help that anyone may provide.