combobox bind problem

2 posts, 0 answers
  1. Mehmet
    Mehmet avatar
    33 posts
    Member since:
    Jul 2010

    Posted 02 Feb 2011 Link to this post

    Hi Telerik,
    When option IsEditable="True"
    ComboBox Data sometimes can not be bind,

    Sometimes is unable to bind to language combobox (2)
    I think combo data(LanguageData) is not synchronize with main data (GetSBSqlAppointments), 
    the combobox late loading than the first Data

    somehow, when apply to  ( IsEditable="True" ) options, this synchronize problem is eliminated.
    you can see in the picture attached about it.

    Thanks,
    -------------------------------------------------
    1)    <riaControls:DomainDataSource x:Name="GuestDetailData" AutoLoad="True" QueryName="GetSBSqlAppointments">
                <riaControls:DomainDataSource.DomainContext>
                    <domain:SchedulerDomainContext />
                </riaControls:DomainDataSource.DomainContext>
            </riaControls:DomainDataSource>

            <riaControls:DomainDataSource x:Name="LanguageData" AutoLoad="True" QueryName="GetLanguage">
                <riaControls:DomainDataSource.DomainContext>
                    <domain:SchedulerDomainContext />
                </riaControls:DomainDataSource.DomainContext>
            </riaControls:DomainDataSource>
    ----------------------
     (2)
    <telerik:RadGridView Name="RadGridViewDetail" ItemsSource="{Binding Data, ElementName=GuestDetailData}"  Margin="0,0,0,0" Width="Auto"   

     Height="395" VerticalAlignment="Top" HorizontalAlignment="Left" CanUserFreezeColumns="False"  CanUserResizeColumns="False"
     AutoGenerateColumns="False" ShowGroupPanel="False" BorderBrush="{x:Null}" IsBusy="{Binding IsBusy, ElementName=GuestDetailData}"
     AutoExpandGroups="False" ShowGroupFooters="False" ShowColumnHeaders="True"
            ShowInsertRow="True" LoadingRowDetails="RadGridViewDetail_LoadingRowDetails"

            RowLoaded="RadGridViewDetail_RowLoaded" >
    ----------------------
     (3)
    <TextBlock Text="Language : " Margin="10,2,0,0" FontWeight="Bold" Grid.Row="1" Grid.Column="3"/>
    <telerik:RadComboBox x:Name="LanguageType" Grid.Column="4" Grid.Row="1"  HorizontalAlignment="Left"
     MaxHeight="22"  Margin="2,0,0,0" VerticalAlignment="Top" Width="130"
     ItemsSource="{Binding Source={StaticResource LanguageData}, Path=Data}" DisplayMemberPath="LanguageName"
     Text="{Binding SBLanguage, Mode=TwoWay}" ClearSelectionButtonContent="Clear" ClearSelectionButtonVisibility="Visible"/>
    -----------------------
     (4)
            void RadGridViewDetail_RowLoaded(object sender, RowLoadedEventArgs e)
            {
                GridViewRow row = e.Row as GridViewRow;
                SBSqlAppointments guest = e.Row.DataContext as SBSqlAppointments;
                if (row != null && guest != null &&
                    RadGridViewDetail.Items.IndexOf(guest) == 0 && !firstItemExpanded)
                {
                    row.DetailsVisibility = Visibility.Visible;
                    firstItemExpanded = true;
                }
            }

  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 04 Feb 2011 Link to this post

    Hi Mehmet,

    I have tried to reproduce the issue you reported, but since I am not quite aware of some of the details, I am not able to test it entirely. Is the RadComboBox defined in the RowDetails template ? Does the data for the RadComboBox correspond to a property from the items of the grid ?
    Furthermore, may you try to define the DomainDataSource in the Resources section and use it as a StaticResource in the setting of the ItemsSource of the RadComboBox:

    <UserControl.Resources>
            <riaControls:DomainDataSource x:Key="orders" QueryName="GetOrdersQuery">
                <riaControls:DomainDataSource.DomainContext>
                    <local:CustomersDomainContext />
                </riaControls:DomainDataSource.DomainContext>
            </riaControls:DomainDataSource>
    </UserControl.Resources>
     
    <telerik:RadComboBox   ItemsSource="{Binding Source={StaticResource orders}, Path=Data}" ...../>

    Greetings,
    Maya
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
Back to Top