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

combobox bind problem

1 Answer 68 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mehmet
Top achievements
Rank 1
Mehmet asked on 02 Feb 2011, 05:16 PM

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

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 04 Feb 2011, 03:02 PM
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>>
Tags
GridView
Asked by
Mehmet
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or