Accessing buttons in RadToolBar

5 posts, 1 answers
  1. Jesús
    Jesús avatar
    53 posts
    Member since:
    Oct 2007

    Posted 09 Dec 2008 Link to this post

    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?
  2. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Dec 2008 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jesús
    Jesús avatar
    53 posts
    Member since:
    Oct 2007

    Posted 09 Dec 2008 Link to this post

    Perfect.

    Thanks.
  5. Hugo Augusto
    Hugo Augusto avatar
    55 posts
    Member since:
    Jul 2004

    Posted 10 Sep 2010 Link to this post

    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.
  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 15 Sep 2010 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017