Multiple editors on the same page

3 posts, 1 answers
  1. Richard
    Richard avatar
    97 posts
    Member since:
    Feb 2009

    Posted 19 Dec 2019 Link to this post

    Is is possible to have more than one editor on a page? 

    When I add 3 like in the example below I can only interact with the first one. 

    By the way, this is a great new control, thank you for adding it. 

    02.    <StackPanel>
    03.        <Grid Margin="0,4">
    04.            <Grid.RowDefinitions>
    05.                <RowDefinition Height="Auto"/>
    06.                <RowDefinition Height="*"/>
    07.            </Grid.RowDefinitions>
    08.            <TextBlock Grid.Row="0" Text="Custom PowerShell"/>
    09.            <telerik:RadSyntaxEditor x:Name="PsEditor" Grid.Row="1" MinHeight="400" />
    10.        </Grid>
    12.        <Grid Margin="0,4">
    13.            <Grid.RowDefinitions>
    14.                <RowDefinition Height="Auto"/>
    15.                <RowDefinition Height="*"/>
    16.            </Grid.RowDefinitions>
    17.            <TextBlock Grid.Row="0" Text="Custom JavaScript"/>
    18.            <telerik:RadSyntaxEditor x:Name="JsEditor" Grid.Row="1" MinHeight="400" />
    19.        </Grid>
    21.        <Grid Margin="0,4">
    22.            <Grid.RowDefinitions>
    23.                <RowDefinition Height="Auto"/>
    24.                <RowDefinition Height="*"/>
    25.            </Grid.RowDefinitions>
    26.            <TextBlock Grid.Row="0" Text="Custom CSS"/>
    27.            <telerik:RadSyntaxEditor x:Name="CssEditor" Grid.Row="1" MinHeight="400" />
    28.        </Grid>
    29.    </StackPanel>
  2. Answer
    Dilyan Traykov
    Dilyan Traykov avatar
    1069 posts

    Posted 20 Dec 2019 Link to this post

    Hello Richard,

    Thank you for the provided code snippet.

    It is indeed possible to define multiple RadSyntaxEditor control in one view but the issue with the setup you've shared is that the ScrollViewer takes the keyboard focus.

    The only modification you need to make to enable input in all 3 controls is to set the Focusable property of the ScrollViewer to False.

    <ScrollViewer Focusable="False">
    Please give this a try and let me know if it solves your issue.

    Dilyan Traykov
    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. Richard
    Richard avatar
    97 posts
    Member since:
    Feb 2009

    Posted 20 Dec 2019 Link to this post

    Thank you Dilyan, it was the ScrollViewer taking focus. It working great now.
Back to Top