
I'm trying to capture when the Enter key is pressed in a RadWatermarkTextBox without adding code to code-behind.
In the XAML I have:
<telerik:RadWatermarkTextBox MinHeight="26"
x:Name="searchCompleteBox"
VerticalAlignment="Center"
Text="{Binding SearchText, Mode=TwoWay}"
Width="200"
WatermarkContent="Enter name, address, or ID">
<telerik:EventToCommandBehavior.EventBindings>
<telerik:EventBinding Command="{Binding OnSearchCompleteBoxKeyDownCommand}"
EventName="KeyDown"
PassEventArgsToCommand="True" />
</telerik:EventToCommandBehavior.EventBindings>
</telerik:RadWatermarkTextBox>In the ViewModel:
private async void OnSearchCompleteBoxKeyDown(System.Windows.Input.KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
await SearchForMembersAsync();
}
}The problem is SearchText is not updating. So if I type something like "smith" OnSearchCompleteBoxKeyDown fires five times, the if result is false five times, but SearchText contains an empty string instead of "smith".
SearchText is declared properly and is updated properly if I take the EventToCommandBehavior code out. This all works properly if I use code-behind but I want to avoid that.
Hi,
does the RadWaterMarktextBox support validation at Property level like the DataGrid validation feature ?
Thank you
Hi,
Would it be possible to have an editable RadMasked Part to mimic the RadWatermarkTextBox with floating Label?
I am trying to apply the same `Margin` style to a lot of `RadWatermarkTextBox` controls by defining the `Margin` as a Style resource:
<Window.Resources>
<Style TargetType="{x:Type telerik:RadWatermarkTextBox}">
<Setter Property="Margin">
<Setter.Value>
<Thickness Bottom="{x:Static controls:Measurements.UnrelatedDistance}" />
</Setter.Value>
</Setter>
</Style>
</Window.Resources>Using the Style above makes the control look different compared to explicitly setting the `Margin` property for each control like below:
<telerik:RadWatermarkTextBox Text="Hello world">
<telerik:RadWatermarkTextBox.Margin>
<Thickness Bottom="{x:Static controls:Measurements.UnrelatedDistance}" />
</telerik:RadWatermarkTextBox.Margin>
</telerik:RadWatermarkTextBox>I am wondering what's the reason for this difference and how to use a Style resource to the make the control look like the way it does when explicitly setting the `Margin` property within the control.
Thank you.
Hi,
Would it be possible to have an editable AutoCompleteBox TextBox Part to mimic the RadWatermarkTextBox with floating Label?
Failed to focus RadWatermarkTextBox
<telerik:RadDropDownButton Margin="10 0"
DropDownIndicatorVisibility="Collapsed"
DropDownPlacement="Mouse">
<telerik:RadDropDownButton.DropDownContent>
<StackPanel Orientation="Horizontal">
<telerik:RadButton Click="AddLocation_OnClick"/>
<telerik:RadWatermarkTextBox
Width="100"
Loaded="RadWatermarkTextBox_Loaded"/>
</StackPanel>
</telerik:RadDropDownButton.DropDownContent>
</telerik:RadDropDownButton>
private void RadWatermarkTextBox_Loaded(object sender, RoutedEventArgs e)
Hi,
Would it be possible to have a editable RadComboBox TextBox Part to mimic the RadWatermarkTextBox with floating Label?
I am using WatermarkTextbox and somehow that looks like it is disabled,
previously I was using xctk:WatermarkTextBox in this I was using KeepWatermarkOnGotFocus="True" which was helping me.
In telerik I am not getting any property as such.
Kindly help me in this.
I want like this
<telerik:RadWatermarkTextBox
HorizontalAlignment="Stretch"
IsReadOnly="True"
Text="{Binding MaterialPartAndName,
ValidatesOnDataErrors=True}"
ToolTip="{Binding MaterialPartAndName}"
cal:Message.Attach="[Event MouseEnter] = [ResetSelectedItem]"
WatermarkContent="Please select a material...">
</telerik:RadWatermarkTextBox>
Regards,
Yogendra
I recently updated Telerik for WPF to the latest version. Since then I have following problem:
When I work with the designer I get this error:
[A]Telerik.Windows.Controls.RadWatermarkTextBox cannot be cast to [B]Telerik.Windows.Controls.RadWatermarkTextBox. Type A originates from 'Telerik.Windows.Controls, Version=2021.2.615.45, Culture=neutral, PublicKeyToken=...' in the context 'LoadFrom' at location 'C:\Program Files (x86)\Progress\Telerik UI for WPF R2 2021\Binaries\WPF45\Telerik.Windows.Controls.dll'. Type B originates from 'Telerik.Windows.Controls, Version=2021.2.615.45, Culture=neutral, PublicKeyToken=....' in the context 'LoadNeither' at location 'C:\Users\user\AppData\Local\Microsoft\VisualStudio\16.0_589b9641\Designer\ShadowCache\sc041jsc.3tf\nxls5byu.o3i\Telerik.Windows.Controls.dll'.
This only occurs on UserControls I want to insert somewhere. So I can use the RadWatermarkTextBox normally. But if it's in a UserControl this error is thrown.
How can I resolve this errror?