Telerik Forums
UI for WPF Forum
0 answers
94 views
I have a controls on a <UserControl> the first of which is a <telerik:RadComboBox>
I have another control that is a <telerik:RadWatermarkTextBox>
I want the second control to have the focus after the screen loads because the combobox has the OpenDropDownOnFocus property set to true.

I use txtPolicyNumber.Focus(); in the after load event but the Combobox grabs the focus.

I even have this code and it still goes to the combobox:

Any suggestions as to what I can do to make Focus() focus?
FrameworkElement focusedElement = Keyboard.FocusedElement as FrameworkElement;
if (focusedElement != null) 
{
    string focusedControlName = focusedElement.Name;
    if (focusedControlName == "txtPolicyNumber")
    {
        iefInsuranceThirdPartyVM.CanAutoDrop = true;
        txtPolicyNumber.Focus();    // WTF is making it focus on the combobox
    }
}


Paul
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 27 Feb 2024
1 answer
84 views

Currently the RadCalculatorPicker only recognize the decimal key from a numeric keypad. This is a problem when working on a laptop that does not have a numeric keypad.

Is there an easy and robust way to capture the period keystroke and "convert" it into a decimal key?

Regards

Renier

Martin Ivanov
Telerik team
 updated answer on 26 Feb 2024
1 answer
117 views

I have a RadGridView where i've replaced the "Full Text Search" with a custom control (TextBox + Label) 

I'm using a Debouncer to collect text changes from the Textbox and then after 300msec - do the search:


if (e.PropertyName == "Query")
{
	debounce.Debounce(() =>
	{
		Dispatcher.Invoke(() =>
		{
			FilterByQuery();
		});
	});
}
FilterByQuery() : 
var searchBytextCommand = RadGridViewCommands.SearchByText as RoutedUICommand;
searchBytextCommand.Execute(Query, radgrid);

Query = String property

radgrid = x:name of the RadGridView.

at some random point in time of the lifetime of the WPF program, this function stops working !

- I dont have any other case of the Debouncer stops working so i trust that it's not the issue. 

- WPF Databinding and PropertyChanged events are also working 1000 other places in the program without failing, so i trust that they work too.

- This leads me to believe that the RadGridViewCommands might have an issue.. 

 

Martin
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 26 Feb 2024
0 answers
76 views

Hi, I would like to change style of schedulerdialogs in ScheduleView. For example, when I click on delete appointment button, this is the style I see:

But I want the style to look like this:

As you can see, the header of this dialog looks different. I am only able to achieve this look for Radwindow not for SchedulerDialog. Is there a way ro do it?

Thank you for your answer

 

 

T
Top achievements
Rank 1
 asked on 26 Feb 2024
0 answers
94 views

We have a issue with WPF RadComboBox to disable the auto selection of first item while databinding.

I have large set of data (say 10000 items) in the application cache.

<telerik:RadComboBox
                                        x:Name="itemBox"
                                        HorizontalAlignment="Stretch"
                                        telerik:TextSearch.TextPath="Name"
                                        CanAutocompleteSelectItems="False"
                                        DisplayMemberPath="Name"
                                        EmptyText="Select item"
                                        IsEditable="True"
                                        IsFilteringEnabled="True"
                                        IsReadOnly="False"
                                        IsTextSearchEnabled="True"
                                        ItemsSource="{Binding ItemCollection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                        OpenDropDownOnFocus="True"
                                        ScrollViewer.VerticalScrollBarVisibility="Auto"
                                        SelectedItem="{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                        TextSearchMode="Contains">

                                                <telerik:EventBinding
                                                Command="{Binding BeginSearchCommand}"
                                                EventName="KeyUp"
                                                PassEventArgsToCommand="True" />
</telerik:RadComboBox>

We have the RadCombobox with Filter enabled.

BeginSearchCommand relay command method has implementation of filtering the cached ItemCollection and setting the value.


this.ItemCollection = new QueryableCollectionView(new ObservableCollection<ItemModel>(filtereditems));

I first load 50 items in RadCombobox and the user will try to search the items from SearchText . Then the items in the cache is filtered with searchtext and the result is assigned with the datasource property.

  1. User start searching
  2. The first item from the filtered result occupies the search text.

The couple of action above continues. Please help us disable autoselect  while databinding.

Praveenraj
Top achievements
Rank 1
 updated question on 24 Feb 2024
0 answers
57 views

As in the title some charactes are getting not displayed in some pdfs.

If I import this pdf: https://jmp.sh/s/mdWM2qNDL2Oi6Yd825s0

Im getting this result its right if you click inside the field but its not getting displayed correct when not inside the field

 

Maybe its something with the font, thats the only thing i could think of.

 

Thanks for the help

Dominik

 

 

Dominik
Top achievements
Rank 1
Iron
Iron
 updated question on 21 Feb 2024
0 answers
74 views
Hello
I have a radgridview with two columns (for simplicity)
The first is defined like this:

RiassuntoSorgentiGrid.Columns.Add(new GridViewDataColumn()
{
				Header = Utility.LoadString(ResourcesKeys.RipetizioniSorgente),
				ColumnGroupName = GENERALGROUPNAME,
				DataFormatString = "D",
				DataMemberBinding = new Binding("Sorgente.Ripetizioni")
				{
					Mode = BindingMode.OneWay
				}
});


The second like this:

RiassuntoSorgentiGrid.Columns.Add(new GridViewDataColumn()
{
				Header = Utility.LoadString(ResourcesKeys.RipetizioniSorgente),
				ColumnGroupName = GENERALGROUPNAME,
				DataFormatString = "D",
				DataMemberBinding = new Binding($"Sorgente.LivelliSingoli[{parametro.Id}][{l}]")
				{
					Mode = BindingMode.OneWay
				}
});


where parametro.Id and l are variables correctly defined and not null.
The grid works good, but in the second columns filtering and sorting are not active, while in the first they do.

Is there a reason for this behavior?
Thank you
Luigi
Luigi
Top achievements
Rank 3
Bronze
Iron
Iron
 updated question on 21 Feb 2024
1 answer
147 views

https://www.telerik.com/forums/setting-background-color-when-control-is-readonly

The above link shows where someone had a similar issue but isn't clear on how to solve it.

I want to set a text box to not look disabled when it is readonly.
In the example below I set the background to red just to demonstrate that nothing happens.

I think it not happening because the application is using a theme (windows11)

Can I set the BasedOn to something that means "current theme", so that it will work?

<!-- Want readonly to not look disabled in many places -->

<Style x:Key="LxReadOnlyRadW"
       TargetType="telerik:RadWatermarkTextBox"
       BasedOn="{StaticResource {x:Type telerik:RadWatermarkTextBox}}">
    <Style.Triggers>
        <Trigger Property="IsReadOnly"
                 Value="True">
            <Setter Property="Background"
                    Value="red" />
        </Trigger>
    </Style.Triggers>
    <Setter Property="IsReadOnly"
            Value="True" />
    
</Style>


Dimitar
Telerik team
 answered on 19 Feb 2024
1 answer
104 views

I would like use a RadVirtualKeyboard to enter pin code in my application. And when I use it with DefaultKeyboardLayout.Numpad it work as expected - shows small pop-up windows with numpad keyboard. But when I try to load my custom layout it shows the same small window but width of keyboard's buttons is super wide. 

I seems that loading custom layout reset width of UI element to full size keyboard and all my customs buttons are stretched.

Could you help me?

var kb = new RadVirtualKeyboard() { VirtualKeyboardTemplateSelector = (VirtualKeyboardTemplateSelector)(MyView.FindResource("KeyTemplateSelector")), DefaultKeyboardLayout = DefaultKeyboardLayout.Numpad }; keyboardWindow = new RadVirtualKeyboardWindow(kb) { Header = "Enter you number", ResizeMode = ResizeMode.NoResize, CanClose = false, Width = 260 };

//load custom layout

byte[] byteArray = Encoding.UTF8.GetBytes(keyLayout); Stream stream = new MemoryStream(byteArray); kb.LoadLayout(stream); keyboardWindow.Show();

Here is my layout:

<RadVirtualKeyboard xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="*" /> 
        </Grid.RowDefinitions> 
        <Grid.ColumnDefinitions> 
            <ColumnDefinition Width="*" /> 
        </Grid.ColumnDefinitions> 
        <KeysLayout KeySpacing="0.1" Grid.Row="0" Grid.Column="0"> 
            <Rows> 
                <Row> 
                    <Keys> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="103" /> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="104" /> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="105" /> 
                        <Key KeyType="Normal" Width="1" Height="1" VirtualKey="109" /> 
                    </Keys> 
                </Row> 
                <Row> 
                    <Keys> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="100" /> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="101" /> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="102" /> 
                        <Key KeyType="Normal" Width="1" Height="1" VirtualKey="107" /> 
                    </Keys> 
                </Row> 
                <Row> 
                    <Keys> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="97" /> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="98" /> 
                        <Key KeyType="Numpad" Width="1" Height="1" VirtualKey="99" /> 
                        <Key DisplayText="Enter" KeyType="Special" Width="1" Height="1" VirtualKey="13" /> 
                    </Keys> 
                </Row> 
            </Rows> 
        </KeysLayout> 
    </Grid> 
</RadVirtualKeyboard> 

And how it is showed

 

Dimitar
Telerik team
 answered on 19 Feb 2024
6 answers
188 views

Hi,

i would like to change the Field Displayname of Properties used in the Pivot-Fieldlist.

I tryed to use the AddingContainerNode Event from LocalDataSourceFieldDescriptionsProvider, but it's only possible to change the

display name like

    (e.ContainerInfo as PropertyInfoFieldInfo).DisplayName = "Test"

This works for the aggregate list, but in List of fields there is always the name of property visible.

I tryed to change also the caption of ContainerNode but there is no Setter implemented.

    e.ContainerNode.Caption ="Test";  //it's not possible, but ist seems to be there right way 

Is there another way to Change the Caption.

Thanks for help.

Best regards

Stephan

Vladimir Stoyanov
Telerik team
 answered on 16 Feb 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?