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

Search Command is not executable

1 Answer 30 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 28 Oct 2020, 02:55 PM

Hello,

I linked the Search Command to the context menu in a gridview but the command is not executable. How can I enable the command?

See code:
        <telerik:RadGridView ItemsSource="{Binding Countries}" IsReadOnly="True" ClipboardCopyMode ="Default"
                             SelectionUnit="Mixed" SelectionMode="Extended"
                             >
            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu x:Name="ContextMenu32">
                    <telerik:RadMenuItem Header="Copy" Command="Copy"/>
                    <telerik:RadMenuItem Header="Open searchbar" Command="Search"/>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
        </telerik:RadGridView>

Thanks in advance for your help.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 30 Oct 2020, 01:45 PM

Hello Martin,

The only modification you need to make to your code is to target the RadGridViewCommands.Search command from the Telerik.Windows.Controls.GridView assembly instead of the native Search command.

            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu x:Name="ContextMenu32">
                    <telerik:RadMenuItem Header="Copy" Command="Copy"/>
                    <telerik:RadMenuItem Header="Open searchbar" Command="telerik:RadGridViewCommands.Search"/>
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>
Please let me know if this provides the desired result.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
GridView
Asked by
Martin
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or