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

Gridview ComboBox Blank Asynchronous load

4 Answers 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Iron
Curt asked on 01 Feb 2012, 01:00 AM
Hello

I have seen the threads regarding blank combobox columns in a RadDataGrid.
In my xaml I set my combobox itemsource to a static resource:

 <UserControl.Resources>
  <solutionData:OrgDataSource x:Name="OrgDS" />
 </UserControl.Resources>
<!-- more xaml -->
    <telerik:GridViewComboBoxColumn Header="Agency"
            DataMemberBinding="{Binding Agency}"
            DisplayMemberPath="Name"
            SelectedValueMemberPath="Name"
            ItemsSource="{Binding Path=Organization, Source={StaticResource OrgDS}}" />

This appears to work most of the time, but occasionally does not.
I watched the traffic in Fiddler and noticed that most times the combobox DataSource was sent back prior to the grid's DataSource, which works. However, the combobox DataSource is populated asynchronously and sometimes will not finish loading before the grid's datasource is returned.
I am trying to get my head around the asynchronous programming; is there some technique that can force my combobox  DataSource to load prior to the grid's DataSource?

Thanks!

4 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 01 Feb 2012, 10:30 AM
Hello Curt,

The thing is that RadComboBox (the editing element of GridViewComboBoxColumn) searches for its selected value only once in the source and stays blank if it does not find it in this attempt. What you can try is to set the ItemsSource of the grid only after the one of the column is loaded completely. However, the most appropriate implementation depends entirely on your settings and structure of the application. 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
vk
Top achievements
Rank 1
answered on 01 Feb 2012, 01:25 PM
Hi Curt

If you're using wcf ria services the following link might be helpfull:
http://blog.falafel.com/blogs/10-08-12/Synchronously_Retrieving_Data_with_WCF_RIA_Services.aspx
0
Curt
Top achievements
Rank 1
Iron
answered on 01 Feb 2012, 08:41 PM
Valentin - thanks for that link, I will probably use that when I have a grid with multiple combobox columns.

I decided to use a RadDomainDataSource as the StaticResource for the combobox data; in that RadDomainDataSource I added code to the LoadedData event that populates the grid. This appears to be working.
0
Maya
Telerik team
answered on 02 Feb 2012, 07:56 AM
Hello,

I am glad that the issue got resolved. Let us know in case you need any further assistance.  

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Curt
Top achievements
Rank 1
Iron
Answers by
Maya
Telerik team
vk
Top achievements
Rank 1
Curt
Top achievements
Rank 1
Iron
Share this question
or