determine the selected toolbaritem

4 posts, 1 answers
  1. adi
    adi avatar
    79 posts
    Member since:
    Feb 2007

    Posted 22 May 2009 Link to this post

    Hi,

    I have a toolbar with a splitbutton and some buttons as childs. I use this toolbar to pre-select something and I'd like to get the selected button of my toolbar to execute some code in an other control event eg. asp button click. How can I get the selected button of the splitbutton like selecteditem in dropdown? Is it possible in general?
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 25 May 2009 Link to this post

    Hi Adi,

    Unfortunately, this is not possible. Please send us your code demonstrating the exact scenario, so we can try to find a work-around.  Thanks in advance

    Greetings,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. adi
    adi avatar
    79 posts
    Member since:
    Feb 2007

    Posted 29 May 2009 Link to this post

    Hi Yana,

    okay. I've found what I was looking for by myself. I use get_item().get_value() on client side with OnClientButtonClicked event. Now I wan't to take the way back and set the SplitButton item by a value. Is this possible?
  5. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 01 Jun 2009 Link to this post

    Hi Adi,

    You should set DefaultButtonIndex of the SplitButton to the index of the button which you shouls be selected. Here is a simple code snippet which demonstrates this:

    var toolbar = $find("<%=Radtoolbar3.ClientID %>");  
    var index = toolbar.findItemByValue("some value").get_index();  
    toolbar.get_items().getItem([index_of_the_split_button]).set_defaultButtonIndex(index); 

    All the best,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top