RowPanel and TextBox question.

Ribbon for WPF Forum

Posted 17 years ago by Brandon Simmons - Programmer, AssimilSoft
Version: 3.0.0402
Avatar
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.
v1 XAML

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

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


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

Comments (1)

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

Maybe try this out:

<StackPanel Orientation="Horizontal">
    <Label Content="Vendor"/>
    <ribbon:TextBox x:Name="textVendor" Width="150"/>
</StackPanel>
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.3) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.