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

Error occurs with ListBox in RadDropDownButton as DropDownContent

1 Answer 13 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Wenhao
Top achievements
Rank 1
Wenhao asked on 17 Jan 2014, 09:28 AM
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

1 Answer, 1 is accepted

Sort by
0
Boris
Telerik team
answered on 21 Jan 2014, 05:31 PM
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 >>
Tags
Buttons
Asked by
Wenhao
Top achievements
Rank 1
Answers by
Boris
Telerik team
Share this question
or