Hi,
I'm using an UltraControlContainerEditor to embed an Ultrabutton in a cell of an Ultratree. Everything works fine except that the button does not display the Text, or any appearance property for that matter. The button looks like I want it in the designer, but when I run the application I only get a button with a default look and no text on it.
I'm using NetAdvantage 2011.2 for Windows forms. Is this a bug or am I doing something wrong?
Thanks,
Cassio
Hi Cassio,
Regarding the button colors, my guess is that your button is using OS themes. The operating system themes are all-or-nothing, so if they are on, you can't change the colors individually. Try setting UseOsThemes to False on your UltraButton.
Regarding the Text, my guess is that you have not set the RenderingControlPropertyName or EditingControlPropertyname on the UltraControlContainerEditor. That's okay, but if you don't set these, the UltraControlContainerEditor will fall back to using the Value property, if there is one, and then back to Text. There's no Value property on UltraButton, so it will likely be using Text. That means that the button's Text property will be set to the Value of the tree cell, which is likely empty. So your text is probably getting erased.
The solution is to set the Value of the cell in the tree to the text you want the button to display and the button should pick that up.
Hi Mike, thanks for the reply. Setting the Value property of the cell did indeed make it appear on the button, which solves my problem. I was setting the RenderingControlPropertyName and EditingControlPropertyName to "Text" before, thinking that it would use the "Text" property of the button to set the value for the cell. However, it seems like it goes the other way, using the value of the cell to set the "Text" on the button. I'm still confused by that, but it's working.
I figured out why the colors and style weren't working too. It wasn't because of OS themes, I had that set to false. It's because UseAppStyling was set to true and my control is part of a much larger application, and the appstyling is being set somewhere else.