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

GridViewComboBoxColumn Binding Problem

2 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sagar
Top achievements
Rank 1
Sagar asked on 12 Jan 2011, 12:44 PM
 <UserControl.Resources>
      
        <riaControls:DomainDataSource x:Key="ddsSkyConditions"
                                          QueryName="GetSkyconditionsQuery"
                                          AutoLoad="True"
                                          LoadedData="ddsSkyConditions_LoadedData"
                                          DomainContext="{StaticResource DomainContext}">

            <riaControls:DomainDataSource.SortDescriptors>
                <riaControls:SortDescriptor PropertyPath="skyconditiondesc"></riaControls:SortDescriptor>
            </riaControls:DomainDataSource.SortDescriptors>
        </riaControls:DomainDataSource>

    </UserControl.Resources>


<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding Path= SkyConditionID,Mode=TwoWay}"
                                                    ItemsSourceBinding="{Binding Data,Source={StaticResource ddsSkyConditions}}"
                                                    DisplayMemberPath="skyconditiondesc"
                                                    SelectedValueMemberPath="skyconditionid" />

If SkyCondtionID=2 then skyconditindesc for id 2 should be selected in combobox but it's not happening.
I don't understand what's wrong in that?
(Combobox contains all values of domain source but none is selected.)

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 13 Jan 2011, 11:07 AM
Hello Sagar,

May you verify that all the properties defined are set correctly - more importantly the one in the DataMemberBinding ? Furthermore, may you take a look at this article to check if the solutions proposed there resolve the issue in your case ?
 

Kind regards,
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>>
0
Sagar
Top achievements
Rank 1
answered on 13 Jan 2011, 11:48 AM
Thanks for reply.
Got my answer.Actually I declared DatameberBinding field i.e SkyConditionID as int and selectedvaluememberpath field i.e skyconditionid which is coming from from database is byte.
that's why it was not selecting any record.Now it's working nicely.
Tags
GridView
Asked by
Sagar
Top achievements
Rank 1
Answers by
Maya
Telerik team
Sagar
Top achievements
Rank 1
Share this question
or