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

SplitButton checked

4 Answers 69 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
eyal
Top achievements
Rank 1
eyal asked on 22 Jan 2010, 02:04 PM
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   

4 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 26 Jan 2010, 10:09 AM
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.
0
eyal
Top achievements
Rank 1
answered on 12 Mar 2010, 12:23 PM
Thank you Yana.

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

Thanks,
eyal
0
Yana
Telerik team
answered on 15 Mar 2010, 05:00 PM
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.
0
eyal
Top achievements
Rank 1
answered on 12 Apr 2010, 01:26 PM
Thanks Yana.

eyal
Tags
ToolBar
Asked by
eyal
Top achievements
Rank 1
Answers by
Yana
Telerik team
eyal
Top achievements
Rank 1
Share this question
or