RowSpan problem

5 posts, 0 answers
  1. J
    J avatar
    21 posts
    Member since:
    Aug 2016

    Posted 19 Oct 2017 Link to this post

    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.

  2. Stefan
    Admin
    Stefan avatar
    959 posts

    Posted 24 Oct 2017 Link to this post

    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.
  3. Stefan
    Admin
    Stefan avatar
    959 posts

    Posted 25 Oct 2017 Link to this post

    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.
  4. J
    J avatar
    21 posts
    Member since:
    Aug 2016

    Posted 31 Oct 2017 in reply to Stefan Link to this post

    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?

  5. Stefan
    Admin
    Stefan avatar
    959 posts

    Posted 01 Nov 2017 Link to this post

    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.
Back to Top