Error occurs with ListBox in RadDropDownButton as DropDownContent

2 posts, 0 answers
  1. Wenhao
    Wenhao avatar
    17 posts
    Member since:
    Jan 2012

    Posted 17 Jan 2014 Link to this post

    Hello Telerik:

    This coule be a really strange issue. I copied the following code from within your demo application, and I just created a UserControl to hold this as below:

        <Grid x:Name="LayoutRoot" Background="White"><br>        <telerik:RadDropDownButton Width="200" Height="24"><br>            <telerik:RadDropDownButton.DropDownContent><br>                <ListBox SelectionChanged="Selector_OnSelectionChanged" Height="200" Width="200" /><br>            </telerik:RadDropDownButton.DropDownContent><br>        </telerik:RadDropDownButton><br>    </Grid>

    MainPage.xaml:

        <Grid x:Name="LayoutRoot" Background="White">

            <!-- Works right! -->
            <slvs2013Test:SilverlightControl1 />
            
            
            <!-- Won't work, exception throws -->
            <!--<slvs2013Test:Class1 />-->
        </Grid>


    Actually, the event handler "Selector_OnSelectionChanged" does nothing but an empty block.

    When I add this UserControl on the page, everything works ok~ However, I create another class which JUST inherits from this UserControl. Sadlly, it does NOT work any more. I add it onto the page, but an exception occurs everytime, that could makes me crazy.

    I attached the source code in this thread, PLEASE HELP!!!!!

    Wenhao
  2. Boris
    Admin
    Boris avatar
    276 posts

    Posted 21 Jan 2014 Link to this post

    Hello Wenhao,

    We managed to reproduce this issue and it is also reproducible if you remove the RadDropDownButton and leave only the ListBox. This appears to be a framework limitation and the XAML parser cannot handle it. You can see this problem reported here and here.
    However, we strongly believe that inheriting a UserControl is considered a bad practice and it should avoided.

    Regards,
    Boris Penev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top