Gridview ComboBox Blank Asynchronous load

5 posts, 0 answers
  1. Curt
    Curt avatar
    15 posts
    Member since:
    Jan 2012

    Posted 31 Jan 2012 Link to this post

    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!
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 01 Feb 2012 Link to this post

    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 >>

  3. vk
    vk avatar
    46 posts
    Member since:
    Jul 2012

    Posted 01 Feb 2012 Link to this post

    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
  4. Curt
    Curt avatar
    15 posts
    Member since:
    Jan 2012

    Posted 01 Feb 2012 Link to this post

    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.
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 02 Feb 2012 Link to this post

    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 >>

Back to Top