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

Inheriting from RadListbox disables listbox! Why?

1 Answer 52 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bexm
Top achievements
Rank 1
Bexm asked on 07 Aug 2008, 03:58 PM
Hello!

I feel as if I am going mad here.
I am using the windows forms rad listbox, but I wanted to add a custom property to it, so I created a custom control and inherited like so:

public partial class ElementTypeRadListBox : RadListBox   
    {  
        public ElementTypeRadListBox()  
        {  
            InitializeComponent();  
        }  
 
       public ProductCreatorEnums.ElementType ElementType { getset; }  
        
    } 

Very very simple, and this has worked perfectly fine when I have done it on radlistItems and various other controls.
The problem is only with the listbox.. when I put it on my form it appears as if it is disabled. The box appears in a light orange in design view and when I run the project the items I am binding appear in the listbox, but I cannot select them.

Please please tell me what I am doing wrong!
Am I not allowed to inherit from the RadListBox, is this something that happens when you do?

Thank you so much in advance.

Bex

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 08 Aug 2008, 02:15 PM
Hello Bexm,

I think the problem is in the visual appearance of the your custom control - it just doesn't have a theme set. If you would like to implement a custom theme for it, please take a a look at this topic in our documentation. Otherwise, if you prefer to use the same themes as the base class, you should add override ThemeClassName property as described in the following KB article.

If you have any other questions, please don't hesitate to write us again.

All the best,
Georgi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Bexm
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or