We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Label for RibbonTextBox

Thread ID:

Created:

Updated:

Platform:

Replies:

129049 Feb 23,2017 06:59 AM Feb 28,2017 06:10 AM WPF 5
loading
Tags: Ribbon
Adam Jones
Asked On February 23, 2017 06:59 AM

Hi,

Is there a way to set a label for the RibbonTextBox so that it appears before the textbox?

Thanks,

Adam

Priyanga Balasubramaniam [Syncfusion]
Replied On February 24, 2017 06:21 AM

Hi Adam,

Thank you for contacting Syncfusion Support.

Currently our RibbonTextBox does not have "Label" property support. We have prepared the workaround sample to meet your requirement.

In this sample, we have added the Attached property "Label" and "LabelHorizontalAlignment" in sample level. Using these properties, we can set Label for RibbonTextBox and align it horizontally.

Please download the sample from the below location.

Sample: RibbonTextBox

Regards,
Priyanga B


Adam Jones
Replied On February 24, 2017 11:09 AM

Hi Priyanga,

Thanks for the workaround, its ugly but it works and I'm happy :) 

fyi just incase you ever decide to add this as a feature - I ended up having the label on the left of the text box rather than above it.

Adam


Priyanga Balasubramaniam [Syncfusion]
Replied On February 27, 2017 04:51 AM

Hi Adam,

Thank you for the update.

In UWP when we set Header for TextBox control it will be placed above the control. Based on this UI we have provided template to display the label above the RibbonTextBox in last updated sample. You can achieve your requirement by changing StackPanel orientation as “Horizontal” in RibbonTextBox template.

We will consider the above request as feature. If you could confirm some specific details, it would help us to implement the feature in line with your requirement.

Please review the following description of the feature and let us know if it conforms to your requirement.

Need to provide Label Property for the RibbonTextBox control to display the label and property to mention the position of label.

Regards,
Priyanga B


Adam Jones
Replied On February 27, 2017 05:36 AM

HI,

"Need to provide Label Property for the RibbonTextBox control to display the label and property to mention the position of label" is an adequate description.

Please note that the actual layout for having the label horizontal was a little more complicated than the vertical option and I needed to set both the stackpanel orientation as well as the VerticalAlignment and padding on the textblock in order for it to look consistent.  You might then want to expose LabelVerticalAlignment and LabelPadding as additional properties.

for Horizontal:
<StackPanel Orientation="Horizontal" >
     <TextBlock 
Padding="0, 0, 5, 0"
VerticalAlignment="Center"
HorizontalAlignment="{Binding Path=(local:RibonTextBoxWithLabel.LabelHorizontalAlignment), RelativeSource={RelativeSource Mode=TemplatedParent}}" 
Text
="{Binding Path=(local:RibonTextBoxWithLabel.Label), RelativeSource={RelativeSource Mode=TemplatedParent}}" />      <Border         x:Name="Bd"         Background="{TemplateBinding Background}"         BorderBrush="{TemplateBinding BorderBrush}"         BorderThickness="{TemplateBinding BorderThickness}"         Width="{TemplateBinding Width}"         SnapsToDevicePixels="true">         <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />      </Border>
</StackPanel>

Thanks and Best Regards,

Adam



Keerthana Jegannathan [Syncfusion]
Replied On February 28, 2017 06:10 AM

Hi Adam,

Thank you for helping us define this feature. We have added it to our feature request list and it will be include in any of our upcoming releases.

Regards,
Keerthana J


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;