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

Dynamic access of RadToolBarDropDown Items

1 Answer 77 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Tobias
Top achievements
Rank 1
Tobias asked on 03 Aug 2011, 03:46 PM

Hi,

i am using a RadToolbar with multiple RadToolBarDropDown-Controls, which are using the OnLoad-Method to attach the Datasource.

My problem is that I am not able to verify, which button has been pressed, because the number of items in the drop down lists is not constant. I need a dynamic solution for this.

I am using something like to following code in the background:

Protected Sub Toolbar1_ButtonClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadToolBarEventArgs) Handles Toolbar1.ButtonClick
        Select Case e.Item.Index
        Case 1
               dim testString as String = e.Item.Text           
        End Select
 
 
End Sub

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 05 Aug 2011, 03:09 PM
Hi Tobias,

Instead of the Index you can use the Value property of the  buttons to determine which one is clicked. To use the Value property first you will need to explicitly specify it.

Kind regards,
Kate
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
ToolBar
Asked by
Tobias
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or