CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2011

    binding of datagridcomboboxcolumn problem

    i'm a newbie and i am trying to fill a datagrid with some data from my list of classes.

    I have 2 classes, clients and kal
    in the calvul class i have a klid that contains the id that corresponds with the Id from Clients

    the datagrid's datacontext is kal (it show some info + clientsname)
    so in my datagrid i want a dropdown with all the clients
    but it should show at startup the value thats is in my klid from kal
    but i can't figure out how to get this working...

    in my code i have
    KalenderGrid.DataContext = Kal;
    gezinColumn.ItemsSource = Klanten;

    my xaml-part looks like this :

    <DataGridComboBoxColumn Header="Gezin" Width="100" x:Name="gezinColumn"
    DisplayMemberPath="KlNaam" SelectedValuePath="Id" Selector.IsSelected="True"
    SelectedValueBinding="{Binding Path=Klanten}" >
    <Style TargetType="{x:Type ComboBox}">
    <Setter Property="ItemsSource" Value="{Binding Path=Kal.Period1.klid, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />

    it shows the column, but it is empty, when i click it open, i can see all my clients..

    could anyone point my in the right direction ?
    thanks in advance

  2. #2
    Join Date
    Nov 2011

    Re: binding of datagridcomboboxcolumn problem

    forgot : i'm using VS2010 C#

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.