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

RadButtonElement Image

3 Answers 196 Views
Panelbar (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mercell
Top achievements
Rank 2
Mercell asked on 10 May 2007, 10:11 AM
Hi!

Just updated to RadControls Q1 2007 and now I can't remove an image from a RadButtonElement.

I have a RadPanelBarGroupElement with two RadButtonElements. When I click on a RadButtonElement I wan't to set an image on this element and clear it from the other. Setting the Image property to null hasn't any effect. The image is still shown on the element. This worked fine in Q4 2006.

Here is my code:
        private void radButtonElement1_Click(object sender, EventArgs e)  
        {  
            radButtonElement1.Image = Resources.MyImage;  
            radButtonElement2.Image = null;  
        }  
 
        private void radButtonElement2_Click(object sender, EventArgs e)  
        {  
            radButtonElement2.Image = Resources.MyImage;  
            radButtonElement1.Image = null;  
        }  
 

How can I remove an image from a RadButtonElement?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Boyko Markov
Telerik team
answered on 10 May 2007, 04:28 PM
Hi Bo Jørgensen,

You could set or remove an image to the RadButtonElement by using its Image, ImageKey or ImageIndex properties.

Another solution is to collapse the ImagePrimitive of the RadButtonElement by changing its Visibility property. You could achieve this doing the following:

    (radButtonElement.Children[1].Children[0] as ImagePrimitive).Visibility = Telerik.WinControls.ElementVisibility.Collapsed; 
 

You could also set the DisplayStyle property of RadButtonElement to be a text only.

I hope this helps.

Greetings,
Ray
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mercell
Top achievements
Rank 2
answered on 11 May 2007, 09:04 AM
Hi Ray

That's exactly what I'm trying to do if you look at my code. I set the Image property to null but that doesn't remove the image.

The exact same code works fine with the Q4 2006 version of the controls so something may have changed.

Thanks

0
Boyko Markov
Telerik team
answered on 11 May 2007, 12:14 PM
I am not sure how this simple bug made it in the official release. I confirm that the Image property does not remove the image if set to null. We will investigate the faulty behavior and will fix it for one of the upcoming releases.

At present you could set the displayStyle property of RadButtonElement  or change the visibility property of RadButtonElement's ImagePrimitive.


Sincerely yours,
Ray
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Panelbar (obsolete as of Q2 2010)
Asked by
Mercell
Top achievements
Rank 2
Answers by
Boyko Markov
Telerik team
Mercell
Top achievements
Rank 2
Share this question
or