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

Programatically modify ToolBarButton

2 Answers 65 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
judo
Top achievements
Rank 1
judo asked on 29 May 2008, 08:36 AM
I am trying to programatically modify a ToolBarButton which I declared in the ASPX page (specifically I want to set the Checked and CheckedonClick properties).

I can't seem to access the ToolBarButton, eg: RadToolBar1.Items(index).Checked = true doesnt work.

How should I achieve this?

2 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 29 May 2008, 08:56 AM
Hi Jude,

You should cast the abstract RadToolBarItem to the RadToolBarButton type, e.g.

Dim item As RadToolBarItem
item = RadToolBar1.Items(index)
If item.GetType Is GetType(RadToolBarButton) Then
    CType(item, RadToolBarButton).Checked = True
    CType(item, RadToolBarButton).CheckOnClick = True
End If

Let me know if that helps.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
judo
Top achievements
Rank 1
answered on 29 May 2008, 10:04 AM
thanks that worked great.

Jude
Tags
ToolBar
Asked by
judo
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
judo
Top achievements
Rank 1
Share this question
or