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

Controlpanel Button instead RadDropDownButton

4 Answers 287 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 05 Nov 2015, 10:56 AM

Hi,

I'm trying to change the controlpanelitem RadDropdownButton into a RadButton. So far any luck. Does anybody know how this can be done?

Thanks in advance!

 

 

4 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 06 Nov 2015, 03:15 PM
Hello Marcel,

Try adding this piece of code inside the RadGridView.ControlPanelItems tag.

<telerik:ControlPanelItem>
    <telerik:ControlPanelItem.ButtonContent>
        <telerik:RadButton Content="Click Me!" Click="RadButton_Click"/>
    </telerik:ControlPanelItem.ButtonContent>
</telerik:ControlPanelItem>

Then you can define the logic behind your button in the RadButton_Click method as explained in this help article. You can also take a look at this article, regarding the RadGridView Control Panel as well as the examples provided in our SDK samples browser.

Regards,
Dilyan Traykov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Marcel
Top achievements
Rank 1
answered on 09 Nov 2015, 08:19 AM

Hi Dilyan.

That simple? Thanks, that did the trick.

Regards,

Marcel

 

0
Heiko
Top achievements
Rank 1
answered on 08 Apr 2016, 02:45 PM

Hi Dilyan,

the answer is fine but not satisfying. Now you have a button inside a button - not so great since the ControlPanelItem is some kind of button itself. Besides that it looks ugly.  What I want is just the ControlPanelItem (=button) to execute a command on my ViewModel. How can this be achieved?

Regards
Heiko

1
Dilyan Traykov
Telerik team
answered on 11 Apr 2016, 01:26 PM
Hello Heiko,

You are free to modify the ControlPanelItemControl ControlTemplate however you like.

I've attached a sample project where I've removed the RadDropDownButton as a whole and setup a RadButton which is bound to a Command in the ViewModel. 

Please have a look and let me know if this would work for you.

Regards,
Dilyan Traykov
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
GridView
Asked by
Marcel
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Marcel
Top achievements
Rank 1
Heiko
Top achievements
Rank 1
Share this question
or