How to use WPF-toolkit.datagrid.combobox on a pagefunction

Mar 6, 2009 at 1:18 PM
Edited Mar 6, 2009 at 1:19 PM
Hello ,

I have made a wizard to insert data in a table.  To create the wizard I use pagefunctions.
I use the WPF-toolkit.datagrid to enter the data. 
But how can I bind the datagrid.combobox itemssource if I cannot use <...Resources>?

And I can not bind the combobox in .cs file because the combobox does not have a name.

If I put the datagrid on a window everything works fine:

<

 

Window.Resources>
<CollectionViewSource x:Key="RactLookup" />
</Window.Resources>
...........
<toolkit:DataGridComboBoxColumn Header="Categorie" MinWidth="75"
                                                               
SelectedValueBinding="{Binding Path=RACT_ID}"
                                                                SelectedValuePath="ID"  DisplayMemberPath="OMSCHRIJVING" >
    <toolkit:DataGridComboBoxColumn.ElementStyle>
        <
Style TargetType="ComboBox">
            <Setter Property="ItemsSource" Value="{Binding Source={StaticResource RactLookup}}" />
            <Setter Property="IsSynchronizedWithCurrentItem" Value="False" />
        </Style>
    </toolkit:DataGridComboBoxColumn.ElementStyle>
    <toolkit:DataGridComboBoxColumn.EditingElementStyle>
       <Style TargetType="ComboBox">
            <Setter Property="ItemsSource" Value="{Binding Source={StaticResource RactLookup}}" />
            <Setter Property="IsSynchronizedWithCurrentItem" Value="False" />
        </Style>
    </toolkit:DataGridComboBoxColumn.EditingElementStyle>
</toolkit:DataGridComboBoxColumn>
...........................
In the code behind:

CollectionViewSource
ractView = (CollectionViewSource)this.FindResource("RactLookup");
ta_ract.Fill(dt_ract);
ractView.Source = dt_ract;

 

 

 

 

How can I solve this?