I am having a strange issue on my WPF application, the text box does not allow adding a space when a space bar is pressed.
I am able to add a space between words on the same text box, but it does not allow me to add space after the last word.
Dimitar
Telerik team
commented on 18 Apr 2024, 12:55 PM
Hi Sgcino,
We do not have any other reports of similar issues. I would kindly ask you to create a sample project that reproduces this and send it to me. This will allow me to investigate this and provide a solution.
Thank you in advance for your patience and cooperation.
The product of the thread is set to RadRichTextBox but this control is not used in the window, only the default Microsoft textboxes. Can you confirm that this is the correct XAML code?
Hi Sgcino,
We do not have any other reports of similar issues. I would kindly ask you to create a sample project that reproduces this and send it to me. This will allow me to investigate this and provide a solution.
Thank you in advance for your patience and cooperation.
Please see below the xml code for the window where there is an issue with space bar now working :
<Windowx:Class="FMan.WinClient.Dispatcher.ChildWindows.AddNotePopupWD"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
Title=" Add Note"
Height="370"
Width="300"
WindowStyle="ToolWindow"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
Closing="Window_Closing">
<Grid>
<Grid
Background="White">
<Grid.RowDefinitions>
<RowDefinition
Height="10" />
<RowDefinition
Height="Auto" />
<RowDefinition
Height="5" />
<RowDefinition
Height="25" />
<RowDefinition
Height="5" />
<RowDefinition
Height="Auto" />
<RowDefinition
Height="5" />
<RowDefinition
Height="Auto" />
<RowDefinition
Height="5" />
<RowDefinition
Height="Auto" />
<RowDefinition
Height="5" />
<RowDefinition
Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="10" />
<ColumnDefinition
Width="Auto" />
<ColumnDefinition
Width="10" />
<ColumnDefinition
Width="Auto" />
<ColumnDefinition
Width="10" />
</Grid.ColumnDefinitions>
<Grid
x:Name="gridAddNoteJobNo"
Grid.Row="1"
Grid.Column="1"
Grid.RowSpan="2"
Grid.ColumnSpan="3"
Height="30">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="Auto" />
<ColumnDefinition
Width="10" />
<ColumnDefinition
Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
Text="Job No"
Grid.Row="1"
Grid.Column="0"
VerticalAlignment="Center"
Width="60" />
<TextBox
x:Name="txtjob"
Height="22"
Grid.Row="1"
Grid.Column="2"
IsReadOnly="True"
Width="130"
HorizontalAlignment="Left"
Text="{Binding strJobOrFaultNo,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</Grid>
<TextBlock
Text="Note Type"
Grid.Row="3"
Grid.Column="1"
VerticalAlignment="Center"
Width="60" />
<telerik:RadComboBox
Grid.Row="3"
Grid.Column="3"
Height="22"
Width="130"
HorizontalAlignment="Left"
ItemsSource="{Binding lstNoteTypeList}"
DisplayMemberPath="NoteType1"
SelectedValuePath="Id"
SelectedItem="{Binding Path=SelectedNoteType,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
<TextBlock
Text="Visible To"
Grid.Row="5"
Grid.Column="1"
VerticalAlignment="Center"
Width="60" />
<ListBox
x:Name="lbVisibleTo"
Grid.Row="5"
Grid.Column="3"
Height="65"
Width="130"
HorizontalAlignment="Left"
SelectionMode="Extended"
ItemsSource="{Binding lstSearchDesignationPopupItemTemplate,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel
Orientation="Horizontal">
<CheckBox
IsChecked="{Binding Path=SelectedDesignation,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
Checked="CheckBox_Checked"
Unchecked="CheckBox_Checked"
Content="{Binding Path=DesignationName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid
x:Name="gridAddNoteEmployee"
Grid.Row="7"
Grid.Column="1"
Grid.RowSpan="2"
Grid.ColumnSpan="3"
Height="70"
Visibility="Visible">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="Auto" />
<ColumnDefinition
Width="10" />
<ColumnDefinition
Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock
Text="Employees"
Grid.Row="0"
Grid.Column="0"
VerticalAlignment="Center"
Width="60" />
<ListBox
x:Name="lstEmplyee"
Grid.Row="0"
Grid.Column="2"
Height="65"
Width="130"
VerticalAlignment="Top"
HorizontalAlignment="Left"
SelectionMode="Multiple"
ItemsSource="{Binding lstSearchUserPopupItemTemplate,Mode=TwoWay}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel
Orientation="Horizontal">
<CheckBox
IsChecked="{Binding Path=SelectedUser}"
Content="{Binding Path=UserName}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<TextBlock
Text="Notes"
Grid.Row="9"
Grid.Column="1"
VerticalAlignment="Center" />
<TextBox
Grid.Row="9"
Grid.Column="3"
Height="100"
Width="200"
VerticalScrollBarVisibility="Visible"
AcceptsReturn="True"
TextWrapping="Wrap"
AcceptsTab="True"
Text="{Binding Path=strNotes,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" PreviewKeyDown="TextBox_PreviewKeyDown" KeyDown="TextBox_KeyDown" />
<Button
Content="Save"
x:Name="Add"
Grid.Row="12"
Grid.Column="3"
Margin="0 0 70 0"
Width="60"
HorizontalAlignment="Right"
Command="{Binding cmdSaveNotes}"
IsEnabled="{Binding isNotesSaveBtn,UpdateSourceTrigger=PropertyChanged}" />
</Grid>
<Canvas
Margin="90,35,300,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="Black"
Visibility="{Binding strVisibleJobNoListBox}">
<ListBox
x:Name="lstJobNo"
Canvas.Left="0"
Canvas.Top="0"
Background="AliceBlue"
Height="100"
Width="120"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ItemsSource="{Binding lstJobNoAutoTextSearchResult}"
SelectedItem="{Binding strSelectedJobNoFromAutoText,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}">
</ListBox>
</Canvas>
</Grid>
</Window>
Hi Sgcino,
The product of the thread is set to RadRichTextBox but this control is not used in the window, only the default Microsoft textboxes. Can you confirm that this is the correct XAML code?
I am looking forward to your reply.