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

determine the selected toolbaritem

3 Answers 66 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
adi
Top achievements
Rank 1
adi asked on 22 May 2009, 04:45 PM
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?

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 25 May 2009, 02:14 PM
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.
0
adi
Top achievements
Rank 1
answered on 29 May 2009, 11:16 PM
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?
0
Accepted
Yana
Telerik team
answered on 01 Jun 2009, 12:43 PM
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.
Tags
ToolBar
Asked by
adi
Top achievements
Rank 1
Answers by
Yana
Telerik team
adi
Top achievements
Rank 1
Share this question
or