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

CssClass selected SplitButton button

1 Answer 77 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
henk
Top achievements
Rank 1
henk asked on 06 Jul 2009, 01:08 PM
I use a sprite for my toolbar button images. I use the CssClass property of the buttons to specify the correct image. I get the following problem, when a splitbutton child button is selected, then the CssClass of the SplitButton is not replaced by the CssClass of the selected child button.

C# Example:

button0.CssClass = "vf vf0"

button1.CssClass = "vf vf1"
button2.CssClass = "vf vf2"
button3.CssClass = "vf vf3"
...

CSS Example:

 

.vf

 

.rtbIcon

 

 

 

 

{

 

height: 32px;

 

 

width: 32px;

 

 

background-image: url(sprite.png)
background-repeat
: no-repeat;

 

}

 

 

.vf0

 

.rtbIcon { background-position : 0 0px; }

 

 

 

.vf1

 

.rtbIcon { background-position : 0 -32px; }

 

 

 

.vf2

 

.rtbIcon { background-position : 0 -64px; }

 

 

 

.vf3

 

.rtbIcon { background-position : 0 -96px; }

 

 

 

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 07 Jul 2009, 12:57 PM
Hi Henk,

I suggest you subscribe to OnClientButtonClicked event and in its handler:

<script type="text/javascript"
    function buttonClicked(sender, args) 
    { 
        args.get_item().get_parent().get_element().childNodes[0].className = args.get_item().get_element().childNodes[0].className
    } 
</script> 

Greetings,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ToolBar
Asked by
henk
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or