This is a migrated thread and some comments may be shown as answers.

RadWindow.Confirm keydown/press

4 Answers 151 Views
Window
This is a migrated thread and some comments may be shown as answers.
Fred
Top achievements
Rank 1
Fred asked on 14 Jan 2015, 01:49 PM
Hi everyone!

I need to enable the user to choose between Yes or No in the RadWindow.Confirm by using the keyboard letters (to be more specific, the "S" letter to confirm and the "N" letter to cancel. This would replace the need to click the yes/no button, allowing the user to make the decision a bit faster. The buttons would still be there but the keyboard letters would be provided as shortcuts.

Is there any way I can achieve that behavior by using the RadWindow.Confirm component?

Thanks in advance,

Fred

4 Answers, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 16 Jan 2015, 12:13 PM
Hello Fred,

You can achieve the desired by using KeyBindings. You will need to extract the default Style and ControlTemplate of RadConfirm as explained in this article from our help documentation. Define the needed KeyBindings in the ControlTemplate as shown below:

<Grid x:Name="LayoutRoot">
    <Grid.InputBindings>
        <KeyBinding Key="S" Command="{x:Static telerik:WindowCommands.Confirm}" />
        <KeyBinding Key="N" Command="{x:Static telerik:WindowCommands.Cancel}"/>
    </Grid.InputBindings>
...
</Grid>

And set the modified Style as ContentStyle of the dialog.

Hope this helps.

Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Fred
Top achievements
Rank 1
answered on 04 Feb 2015, 06:46 PM
Hello Kalin,

Thanks for the answer, it worked like a charm!

By the way, is there a way to format the confirm button text in a way that the first letter is underlined? For example, in the "Sim" button, can I have the "S" underlined and the rest of the text unchanged?

Thank you!

Regards,
Fred
0
Accepted
Kalin
Telerik team
answered on 05 Feb 2015, 02:11 PM
Hi Fred,

You can try the approach demonstrated here. Note that you would need to also remove the following property from the Button in the Template:

telerik:LocalizationManager.ResourceKey="Ok"

Hope this helps.

Regards,
Kalin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Fred
Top achievements
Rank 1
answered on 05 Feb 2015, 06:15 PM
It worked perfectly, thank you!
Tags
Window
Asked by
Fred
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Fred
Top achievements
Rank 1
Share this question
or