RowPanel and TextBox question.

Ribbon for WPF Forum

Posted 16 years ago by Brandon Simmons - Programmer, AssimilSoft
Version: 3.0.0402
I recently upgraded one of my applications to use the 3.0 version of the ribbon. There were some changes in three row variants to RowPanel that I've been able to change with no problems. My problem is with a TextBox control that I had in one of my RowPanels. I was using a RowPanelItemGroup to enclose a TextBox and a Button. The button is a submit button for the text a user enters into the text box, so I needed them grouped together horizontally. I had a label on the text box and using the UseLabelWhenNoImage property I was able to have that display next to my text box. In the new version this property was removed and I cannot get my label to display anymore. In the documentation it shows a Find text box with the label showing but it mentions something about stack panel only. As a workaround I stuck a Label control in the ButtonGroup before my text box. This works, but there is a small rectangle in between the label and text box. This is fine, but I'm a perfectionist on this stuff so it bugs me a little. (After looking at this a little more, it was due to a Margin I had set previously for the TextBox) With all that said, has support for label display in a RowPanel for text boxes been removed? Perhaps I'm just unable to find in the documentation how to display it? Thanks in advance for your help.

Here's a before and after of the xaml code for the RowPanel.

<r:RowPanel ThreeRowVariantGroupSize="Large">
    <r:RowPanelItemGroup ThreeRowLocation="Middle">
        <r:TextBox x:Name="textVendor" Label="Vendor" Width="150"
        <r:Button x:Name="buttonVendorSubmit" Label="Submit"/>

        <Label Content="Vendor"/>
        <r:TextBox x:Name="textVendor" Width="150"/>
        <r:Button x:Name="buttonVendorSubmit" Label="Submit"/>

[Modified at 12/21/2007 03:28 PM]

Comments (1)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Brandon,

Maybe try this out:

<StackPanel Orientation="Horizontal">
    <Label Content="Vendor"/>
    <ribbon:TextBox x:Name="textVendor" Width="150"/>
By wrapping the Label and ribbon:TextBox in a native StackPanel with Horizontal orientation, you ensure that they are in the same ButtonGroup child and avoid having the separator lines drawn between them.

Let us know if that resolves it for you.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.