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

[Solved] ItemSourceBinding ???

4 Answers 160 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul Dyksterhouse
Top achievements
Rank 1
Paul Dyksterhouse asked on 16 Jan 2010, 12:59 AM
Here it shows a combo box who's ItemSourceBinding is a CurrentDriver collection, but it is never explained how CurrentDriver collection is generated.

http://www.telerik.com/help/silverlight/gridview-columns-column-types.html#GridViewComboBoxColumn

Whenever I try to use ItemSourceBinding, I kill Silverlight.

Example:
Grid
<TelerikGridView:RadGridView x:Name="ComponentsGridView"  
                                     Grid.Row="3" 
                                     AutoGenerateColumns="False" 
                                     IsBusy="{Binding IsLoadingData, ElementName=ComponentsDataSource}" 
                                     ItemsSource="{Binding Data, ElementName=ComponentsDataSource}" 
                                     AddingNewDataItem="ComponentsGridView_AddingNewDataItem"
   <TelerikGridView:RadGridView.Columns> 
 
                <TelerikGridView:GridViewComboBoxColumn Header="Unit"  
                                                        ItemsSourceBinding="{Binding UnitOfMeasureDateSource}" 
                                                        DataMemberBinding="{Binding UnitOfMeasureId}"  
                                                        UniqueName="Unit"  
                                                        SelectedValueMemberPath="Id"   
                                                        DisplayMemberPath="Description" /> 
                 
                 
   </TelerikGridView:RadGridView.Columns> 
</TelerikGridView:RadGridView> 

Data Source
        <riaControls:DomainDataSource x:Name="UnitOfMeasureDateSource" QueryName="GetUnitOfMeasures"  AutoLoad="True"
            <riaControls:DomainDataSource.FilterDescriptors> 
                <riaData:FilterDescriptorCollection> 
                    <riaData:FilterDescriptor Operator="IsEqualTo" Value="True" PropertyPath="Active"/> 
                </riaData:FilterDescriptorCollection> 
            </riaControls:DomainDataSource.FilterDescriptors> 
            <riaControls:DomainDataSource.SortDescriptors> 
                <riaData:SortDescriptor Direction="Ascending" PropertyPath="Description" /> 
            </riaControls:DomainDataSource.SortDescriptors> 
            <riaControls:DomainDataSource.DomainContext> 
                <riaServices:ProductPrototypingToolDomainContext /> 
            </riaControls:DomainDataSource.DomainContext> 
        </riaControls:DomainDataSource> 

What am I doing wrong? - THX for any help.



4 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 21 Jan 2010, 08:22 AM
Hello Paul Dyksterhouse,

Please check the attached sample project. It demonstrates how ItemSourceBinding can be used. Basically it can bound to Collection property of the current row data item.

If you have any more questions do not hesitate to contact us.

Greetings,
Tsvyatko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Paul Dyksterhouse
Top achievements
Rank 1
answered on 22 Jan 2010, 07:51 PM
In testing the code that was provided the following error occurred:

Warning    1    Field 'DDS3.Web.Employee.EmployeeMetadata.Orders' is never assigned to, and will always have its default value null   ...DDS3.Web\Employee.cs    17    32    DDS3.Web

Other than that it seems to run.

0
Paul Dyksterhouse
Top achievements
Rank 1
answered on 22 Jan 2010, 08:26 PM
This works in a Many to Many relationship by your example. Can this work in a belongs to association?
0
Tsvyatko
Telerik team
answered on 28 Jan 2010, 10:03 AM
Hello Paul Dyksterhouse,

I am not sure I understand your question.
 The sample provided demonstrate how to use one->many relation ( Employee->Order). Can you please clarify what relation do you mean by association?

Greetings,
Tsvyatko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Paul Dyksterhouse
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Paul Dyksterhouse
Top achievements
Rank 1
Share this question
or