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

Customized Field - DataFormComboBoxField

2 Answers 184 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Vivian
Top achievements
Rank 1
Vivian asked on 24 Mar 2011, 08:55 PM
Hi,

How can I define the DataFormComboBoxField in my own Template?
Take telerik's code for testing:
        <Grid.Resources>
            <DataTemplate x:Key="MyTemplate">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <telerik:DataFormDataField Label="First Name" DataMemberBinding="{Binding FirstName, Mode=TwoWay}" />
                    <telerik:DataFormDataField Grid.Column="1" Label="Last Name" DataMemberBinding="{Binding LastName, Mode=TwoWay}" />
                    <telerik:DataFormComboBoxField Grid.Column="0" Grid.Row="1" Label="Occupation" Width="140"
                                                   ItemsSource="{Binding OccupationPositions}" />
                </Grid>
            </DataTemplate>
        </Grid.Resources>

The comboBox can't get the itemsSource, need help!

Thanks

2 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 29 Mar 2011, 04:56 PM
Hello Vivian,

You will need to set the 3 properties of the combo box field  - ItemsSource, SelectedValuememberPath and DisplayMemberPath.

The DataContext of the combo field would be the current item of the RadDataForm .

The way you are setting ItemsSource - ItemsSource="{Binding OccupationPositions}"  means you expect the OccupationPositions is a property of the current item.

Can you please check and let me know where is the OccupationPositions property defined ?
Also if you give me enough details on your data model , I will gladly prepare a small working example for you .

Kind regards,
Pavel Pavlov
the Telerik team
0
Ariel
Top achievements
Rank 1
answered on 27 Feb 2012, 10:59 PM
Can you please show me how to set the itemsource for a customized

DataFormComboBoxField

( RadCombobox)  in Content. The itemsource is from a plain WCF service. Thnak you very much
Tags
DataForm
Asked by
Vivian
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Ariel
Top achievements
Rank 1
Share this question
or