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

Accessing buttons in RadToolBar

4 Answers 188 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Jesús
Top achievements
Rank 1
Jesús asked on 09 Dec 2008, 10:45 AM
I'm migrating form 2007 Q2 release to 2008 Q3 release.

I have an scenario with different RadToolBarButtons that I control what of them I want to show and what of them I want to hide, depending of some parameter values.

In the previous version I could refer the buttons using myToolBar.Items.GetButtonByCommandName("myCommandName"). What I have to do right now?

4 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 09 Dec 2008, 12:46 PM
Hi El,

You should use FindButtonByCommandName method of RadToolBar like this:

RadToolBarButton btn = (RadToolBarButton) myToolBar.FindButtonByCommandName(name); 

Greetings,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jesús
Top achievements
Rank 1
answered on 09 Dec 2008, 03:16 PM
Perfect.

Thanks.
0
Hugo Augusto
Top achievements
Rank 2
Iron
Veteran
Iron
answered on 11 Sep 2010, 12:53 AM
Just want to warn that this information should be on the "Migrating From RadToolBar ASP.NET to ASP.NET AJAX" chapter of the manual. I don't really understand why you choose this way of accessing Items.

If you need to change some properties on some amount of buttons, using the new method

RadToolBarButton btn = (RadToolBarButton) myToolBar.FindButtonByCommandName(name);

over the old one

myToolBar.Items.GetButtonByCommandName("myCommandName").property = ...

is really turning things more difficult don't you think? The curious thing is that some of the properties are there when using myToolBar.FindButtonByCommandName(name).property, but unfortunately, enabled property isn't.
0
Peter
Telerik team
answered on 15 Sep 2010, 02:53 PM
Hi Hugo,

Thanks for your feedback. We will review the "Migrating From RadToolBar ASP.NET to ASP.NET AJAX" chapter and update it accordingly.


Greetings,
Peter
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
ToolBar
Asked by
Jesús
Top achievements
Rank 1
Answers by
Yana
Telerik team
Jesús
Top achievements
Rank 1
Hugo Augusto
Top achievements
Rank 2
Iron
Veteran
Iron
Peter
Telerik team
Share this question
or