SplitButton checked

5 posts, 0 answers
  1. eyal
    eyal avatar
    54 posts
    Member since:
    Sep 2009

    Posted 22 Jan 2010 Link to this post

    Hi,

    I'm using a toolbar with a SplitButton and several Buttons (see attached image).
    When a button is clicked, its css state remains 'clicked' until another button is clicked. That's great. I would like to have the same behavior also to the SplitButton. If we refer to the attached image, it means that the SplitButton 'test 1' should appear 'Clicked' (same as the 'test 6' button) once it is clicked or one of its selection buttons are clicked.

    Thanks for any help.
    eyal   
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 Jan 2010 Link to this post

    Hello eyal,

    This is not supported out of the box, but you can achieve it using javascript. I've attached a simple page demonstrating this, please download it and give it a try.

    Kind regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. eyal
    eyal avatar
    54 posts
    Member since:
    Sep 2009

    Posted 12 Mar 2010 Link to this post

    Thank you Yana.

    I face difficulties to implement it in server-side.
    Is there a way to achieve it in server-side?

    Thanks,
    eyal
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 15 Mar 2010 Link to this post

    Hello Eyal,

    It can be done only with the latest release of RadControls (Q1 2010) as it introduces new property OuterCssClass of the toolbar buttons. You just need to subscribe to OnButtonClick event and in its handler:

    protected void RadToolBar2_ButtonClick(object sender, RadToolBarEventArgs e)
    {
        if (e.Item.Parent != sender)
        {
            ((RadToolBarSplitButton)e.Item.Parent).OuterCssClass = "rtbItemClicked";
            for (int i = 0; i < RadToolBar2.Items.Count; i++)
            {
                if (RadToolBar2.Items[i].GetType().FullName == "Telerik.Web.UI.RadToolBarButton")
                    ((RadToolBarButton)RadToolBar2.Items[i]).Checked = false;
            }
        }
        else
        {
            for (int i = 0; i < RadToolBar2.Items.Count; i++)
            {
                if (RadToolBar2.Items[i].GetType().FullName == "Telerik.Web.UI.RadToolBarSplitButton")
                    ((RadToolBarSplitButton)RadToolBar2.Items[i]).OuterCssClass = "";
            }
        }
    }


    Greetings,
    Yana
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. eyal
    eyal avatar
    54 posts
    Member since:
    Sep 2009

    Posted 12 Apr 2010 Link to this post

    Thanks Yana.

    eyal
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017