Home Forums WPF controls Xceed DataGrid for WPF Binding Column to Dynamic source

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24755 |

    I have two combo box columns in my grid that aren’t populating their values. There are dynamic DataTable objects. PaymentMthds is populated on load and Subscriptions isn’t populated until the user clicks a search button on the form. When the seach button is pressed is also when the grid is populated with its values. I have a get method defined for both of these DataTables

    Here is a sample from the C# code:
    gcInvoiceLineItems.Columns[“Subscription”].CellEditor = this.FindResource(“subscriptionEditor”) as CellEditor;
    gcInvoiceLineItems.Columns[“PaymentMthd”].CellEditor = this.FindResource(“paymentEditor”) as CellEditor;

    and here is the Xaml: (Built from one of your samples)
    <xcdg:CellEditor x:Key=”paymentEditor”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <ComboBox BorderThickness=”0″
    Background=”Transparent”
    Foreground=”{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(TextElement.Foreground)}”
    MinHeight=”22″
    SelectedItem=”option_name”
    SelectedValuePath=”option_id”
    ItemsSource=”{Binding Path=PaymentMthds}”
    SelectedValue=”{xcdg:CellEditorBinding}”>
    <ComboBox.Resources>
    <Style TargetType=”Popup”>
    <Setter Property=”TextElement.Foreground”
    Value=”{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}” />
    </Style>
    </ComboBox.Resources>
    </ComboBox>
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    <xcdg:CellEditor.ActivationGestures>
    <xcdg:KeyActivationGesture SystemKey=”Down”
    Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”Up”
    Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”F4″/>
    <xcdg:KeyActivationGesture Key=”Space”/>
    </xcdg:CellEditor.ActivationGestures>
    </xcdg:CellEditor>
    <xcdg:CellEditor x:Key=”subscriptionEditor”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <ComboBox BorderThickness=”0″
    Background=”Transparent”
    Foreground=”{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(TextElement.Foreground)}”
    MinHeight=”22″
    VerticalContentAlignment=”Top”
    SelectedItem=”name”
    SelectedValuePath=”subscription_id”
    ItemsSource=”{Binding Source={x:Static Application.Current},Path=Subscriptions}”
    SelectedValue=”{xcdg:CellEditorBinding}”>
    <ComboBox.Resources>
    <Style TargetType=”Popup”>
    <Setter Property=”TextElement.Foreground”
    Value=”{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}” />
    </Style>
    </ComboBox.Resources>
    </ComboBox>
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    <xcdg:CellEditor.ActivationGestures>
    <xcdg:KeyActivationGesture SystemKey=”Down”
    Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”Up”
    Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”F4″/>
    <xcdg:KeyActivationGesture Key=”Space”/>
    </xcdg:CellEditor.ActivationGestures>
    </xcdg:CellEditor>

    Please help me figure out why I don’t see the combo box in the cell.

    Thanks
    rmd

    Imported from legacy forums. Posted by Sherry (had 487 views)

    Xceed Support
    Member
    Post count: 5658

    Are there any binding errors in your output window and/or are you getting an exception?

    Imported from legacy forums. Posted by Jenny [Xceed] (had 206 views)

    User (Old forums)
    Member
    Post count: 23064

    I get this:

    System.Windows.Data Error: 35 : BindingExpression path error: ‘Subscriptions’ property not found on ‘object’ ”App’ (HashCode=36614568)’. BindingExpression:Path=Subscriptions; DataItem=’App’ (HashCode=36614568); target element is ‘DataCell’ (Name=”); target property is ‘Content’ (type ‘Object’)
    System.Windows.Data Error: 35 : BindingExpression path error: ‘PaymentMthds’ property not found on ‘object’ ”App’ (HashCode=36614568)’. BindingExpression:Path=PaymentMthds; DataItem=’App’ (HashCode=36614568); target element is ‘DataCell’ (Name=”); target property is ‘Content’ (type ‘Object’)

    Imported from legacy forums. Posted by Sherry (had 3206 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.