This is a migrated thread and some comments may be shown as answers.

RowSpan problem

4 Answers 241 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 19 Oct 2017, 12:58 PM

Is there a problem with RowSpan support in RadAutoCompleteBox class? The vertical scroll bar doesn't seem to extend all the way.

Try this out with your "Highlight Matching Items Text" example in your samples browser software.

Add new row to the grid:

<Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>
</Grid.RowDefinitions>

 

Then set RadAutoCompleteBox object's RowSpan to 2:

Grid.RowSpan="2"

 

Then subscribe to Loaded event in Example.xaml.cs:

public Example()
{
    InitializeComponent();
 
    AutoComplete.Loaded += AutoComplete_Loaded;
}
 
private void AutoComplete_Loaded(object sender, RoutedEventArgs e)
{
    RadWatermarkTextBox watermark = (sender as RadAutoCompleteBox).ChildrenOfType<RadWatermarkTextBox>().FirstOrDefault();
    if (watermark != null)
    {
        watermark.AcceptsReturn = true;
        watermark.TextWrapping = TextWrapping.Wrap;
        watermark.VerticalAlignment = VerticalAlignment.Center;
        watermark.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
    }
}

 

Then run the example and you see how the scroll bar is only the height of the first row. It grows when you type text with new rows. Doesn't look good if you want to always show the vertical scroll bar (disabled when not enough text to scroll).

Haven't tested this with horizontal scroll bar.

By the way, is there a way to configure the RadAutoCompleteBox object to use textwrapping in XAML. I only found the above way by googling and I'd like not to use events. Handled with extending the class and subscribing to the event in the extended class' code.

4 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 24 Oct 2017, 12:37 PM
Hello J H,

Thank you for the code provided.

I managed to replicate the undesired behavior with it. I am reviewing the case, but I need a little more time for this. I will update you with my findings shortly.

Thanks in advance for understanding.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Stefan
Telerik team
answered on 25 Oct 2017, 12:59 PM
Hi J H,

Firstly, thank you for your patience.

It seems that the reported behavior is due to vertical scrollbar being set directly to the editor of the control. Instead, you need to set it to the RadAutoCompleteBox. I tested the approach and the control seems to behave as expected with such setup. Can you please share whether there are any obstacles to using it?

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
J
Top achievements
Rank 1
answered on 31 Oct 2017, 11:58 AM

How do I do it? There's no VerticalScrollbarVisibility property in RadAutoCompleteBox?

What about the text wrapping question? Is inheriting the RadAutoCompleteBox class and handling the Loaded event the only way? I.e., not possible in XAML?

0
Stefan
Telerik team
answered on 01 Nov 2017, 03:43 PM
Hi J H,

In order to set the VerticalScrollbarVisibility of RadAutoCompleteBox, you can set it directly to its ScrollViewer, as it is an attached property. Please, take a look at the snippet below.
<telerik:RadAutoCompleteBox x:Name="AutoComplete"
                                    Loaded="AutoComplete_Loaded"
                                    Grid.Row="1"
                                    ScrollViewer.VerticalScrollBarVisibility="Visible"
                                    Grid.RowSpan="2"/>

As to setting the TextProperties of the editor of the control, using the Loaded event would be the effortless solution. Otherwise, you need to edit the template of the control and apply your changes in it. This is discussed in the Text manipulation in WatermarTextBox forum thread as well.

Hopefully, this helps.

Regards,
Stefan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
AutoCompleteBox
Asked by
J
Top achievements
Rank 1
Answers by
Stefan
Telerik team
J
Top achievements
Rank 1
Share this question
or