Inheriting from RadListbox disables listbox! Why?

2 posts, 0 answers
  1. Bexm
    Bexm avatar
    67 posts
    Member since:
    May 2007

    Posted 07 Aug 2008 Link to this post

    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
  2. Georgi
    Admin
    Georgi avatar
    212 posts

    Posted 08 Aug 2008 Link to this post

    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.
Back to Top