RadDropDownButton - Textboxes ignore the first <space> character...

4 posts, 0 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 31 Aug 2011 Link to this post

    There was a very similar issue to this logged here.

    And here is a simple project showing the problem.  Notice that when you attempt to enter a <space> in either of the TextBox controls, the first keypress seems to be ignored.  Subsequent <space> characters are ok.

    <UserControl    x:Class="SilverlightApplication61.MainPage"
       <DataTemplate x:Key="LabelTemplate">
          <TextBlock Text="{Binding ., StringFormat='\{0\}:'}" VerticalAlignment="Center" Foreground="Green" FontSize="12" Margin="25,0,5,0" />
    <Grid x:Name="LayoutRoot" Background="White">
       <telerik:RadDropDownButton Height="50" Width="50" DropDownWidth="280">
                   <RowDefinition Height="Auto" />
                   <RowDefinition Height="Auto" />
                   <ColumnDefinition Width="Auto" />
                   <ColumnDefinition Width="1*" />
                <telerik:Label Grid.Row="0" Grid.Column="0" Content="Field 1" ContentTemplate="{StaticResource LabelTemplate}" />
                <TextBox Grid.Row="0" Grid.Column="1" FontSize="14" Text="{Binding Field1, Mode=TwoWay}" Margin="0,4,3,2" />
                <telerik:Label Grid.Row="1" Grid.Column="0" Content="Field 2" ContentTemplate="{StaticResource LabelTemplate}" />
                <TextBox Grid.Row="1" Grid.Column="1" FontSize="14" Text="{Binding Field2, Mode=TwoWay}" Margin="0,4,3,2" />

  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 05 Sep 2011 Link to this post

    Hi Rob,

    This is a known issue that is logged in our PITS where you can track its progress. We will do our best to fix it as soon as possible and you can vote for it in order to increase its priority.

    Tina Stancheva
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Juliana
    Juliana avatar
    71 posts
    Member since:
    Feb 2008

    Posted 23 Sep 2011 Link to this post

    Hi there,
    I use the following workaround for this problem

    private void TextBox_KeyDown(object sender, KeyEventArgs e)
                switch (e.Key)
                    case System.Windows.Input.Key.Space:
                        AddCharachterToTextBox((TextBox)e.OriginalSource, " " );
                        e.Handled = true;
                    case System.Windows.Input.Key.Enter:
                        AddCharachterToTextBox((TextBox)e.OriginalSource, "\n");
                        e.Handled = true;
            void AddCharachterToTextBox(TextBox textBox, string newChar)
                int position = textBox.SelectionStart;
                textBox.Text = textBox.Text.Insert(textBox.SelectionStart, newChar);
                textBox.SelectionStart = position + newChar.Length;

  4. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 26 Sep 2011 Link to this post

    Hello Juliana,

    Thank you for sharing your solution with the community. I am sure it will be highly appreciated.

    Kind regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top