Combo box selected item reloads a null value

2 posts, 0 answers
  1. Cameron Adams
    Cameron Adams avatar
    1 posts
    Member since:
    Sep 2009

    Posted 17 Sep 2009 Link to this post

    I'm having a really hard time working this out so I'm hoping someone can slap me, tell me I'm stupid and point me in the right direction. I've got a RadComboBox loading into a Column a Telerik GridView. The item source for the combo box is loading from a collection which is a static resource. What I'm seeing is that the control loads correctly, including loading the correct selected item, then it refreshes and the selected item becomes null. I'm not up-to-speed with the silverlight control lifecycle so I've got no idea what's going on.

    <telerikGridView:GridViewDataColumn IsReadOnly="True" Width="Auto" Header="Acquisition Method" DataMemberBinding="{Binding AcquisitionMethodID}"
                        <telerikGridView:GridViewDataColumn.CellTemplate> 
                            <DataTemplate> 
                                    <telerikInput:RadComboBox x:Name="AcqMethod"  
                                                              Loaded="RadComboBox_Loaded"  
                                                              IsReadOnly="True" 
                                                              HorizontalAlignment="Left"  
                                                              VerticalAlignment="Top"  
                                                              Width="167"  
                                                              ItemsSource="{Binding Mode=OneWay
                                                                                Source={StaticResource CodeTables}, 
                                                                                Path=AcquisitionMethod}" 
                                                              SelectedValuePath="AcquisitionMethodID"  
                                                              SelectedValue="{Binding Mode=TwoWay
                                                                                Path=AcquisitionMethodID}"  
                                                              DisplayMemberPath="AcquisitionMethod"/> 
                                </DataTemplate> 
                            </telerikGridView:GridViewDataColumn.CellTemplate> 
                        </telerikGridView:GridViewDataColumn> 


    Any help would be very welcome.
    Thanks
    Cam
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 23 Sep 2009 Link to this post

    Hi Cam,

    I created a simple application that demonstrates my understanding of your problem, please, find it attached. However, it seems that it works properly with the latest internal build (that is not released yet). Am I doing something wrong? You could also try to upgrade the assemblies in your application with the latest internal build available and see if it works, because the problem could be caused by a bug that has been already fixed. I also saw that you have a handler for the Loaded event in RadComboBox - it could contain code that causes the problem, if the upgrade and my application did not help, I would like to see what's in this handler.

    Greetings,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top