Programatically modify ToolBarButton

3 posts, 0 answers
  1. judo
    judo avatar
    19 posts
    Member since:
    Apr 2006

    Posted 29 May 2008 Link to this post

    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. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 29 May 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. judo
    judo avatar
    19 posts
    Member since:
    Apr 2006

    Posted 29 May 2008 Link to this post

    thanks that worked great.

    Jude
Back to Top