Hey there,
i'm a bit wondered, that nobody asked this before, or i'm just to blind to find this topic...
Every IG Control has some properties set to "Default". How i can set this default value in a global project scale?
My intention is, to change the property "AutoCompleteMode" of all "UltraComboEditor" and "UltraCombo" to "SuggestAppend". All controls got as value "Default" in this property.
This is a change in a pretty big project, so i don't want to change this for every control in every single form.
Thank you :)
A lot of our enums have a Default option so that you can override them at various levels and objects and also AppStylist.
As an example, take the AllowColSizing property in the UltraWinGrid. This property exist on the Override object, which means you can set in on the Band or on the Layout (all bands). The more specific settings overrides the less specific one.
AllowColSizing defaults to allowing the user to resize the grid columns. If you wanted to turn off sizing for a single band, you could turn it off for a single band's override:
this.ultraGrid1.DisplayLayout.Bands[2].Override.AllowColSizing = AllowColSizing.None;
But suppose you have 100 bands, and you wanted to turn off sizing for all bands except one. Without a Default option, you would have to loop through all of the bands and turn off sizing for 99 of them.
But since we have a Default options, this allows you to turn off sizing for all bands and then simply apply an exception to one of them:
this.ultraGrid1.DisplayLayout.Override.AllowColSizing = AllowColSizing.None; this.ultraGrid1.DisplayLayout.Bands[2].Override.AllowColSizing = AllowColSizing.Free;
The setting on the DisplayLayout.Override applies only to bands that don't already have a more specific setting on the Band override - in other words, it only applies to bands whose band.Override.AllowColSizing is set to Default.
This is just a simple example, of course. And frankly, I'm not sure why AutoCompleteMode has a Default option, since as far as I can tell, that enum is not used on an Override or similar object. Maybe we did it that way just in case we decided to add some sort way to set that property's default at a higher level on some sort of ultimate default object. Or maybe it was just done that way out of habit.
That's a good idea!
I really thought, the default value would be configurable. What purpose does it have anyways? (It always represents one value that's also in the options for the property, so why not just set it to this value...?)
My request was answered, thank you
One potential approach you could take here that would minimize the amount of code you need to change would be to derive a control from UltraComboEditor and then set this property (and any others you want) in the Controls constructor. That way, you only have to set the property once, and then just do a Find/Replace to change the type from UltraComboEditor to your derived type without any other code changes.
Hello,
Thank you for posting. Unfortunately, there is no way to set the default value globally in the project, you have to set them to each control. But this would be a nice feature for our product.You can suggest new feature ideas for future versions (or vote for existing ones) at <http://ideas.infragistics.com>.
Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. You can also link back to this thread for additional details.
Thank you in advance to submitting your product idea
RegardsDivya JainAssociate S/W developer