Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

combobox in datagrid wpf

<DataGridComboBoxColumn 
    SelectedValueBinding="{Binding CompanyID}" 
    DisplayMemberPath="Name" 
    SelectedValuePath="ID">

    <DataGridComboBoxColumn.ElementStyle>
        <Style TargetType="{x:Type ComboBox}">
            <Setter Property="ItemsSource" Value="{Binding Path=DataContext.CompanyItems, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
        </Style>
    </DataGridComboBoxColumn.ElementStyle>
    <DataGridComboBoxColumn.EditingElementStyle>
        <Style TargetType="{x:Type ComboBox}">
            <Setter Property="ItemsSource" Value="{Binding Path=DataContext.CompanyItems, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
        </Style>
    </DataGridComboBoxColumn.EditingElementStyle>
</DataGridComboBoxColumn>
Comment

binding combobox header datagrid wpf

"{Binding DataContext.oTran, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}}"
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# generic return type in interface 
Csharp :: c# only letters 
Csharp :: c# float 
Csharp :: c# windows forms cancel event 
Csharp :: csharp bubble sort 
Csharp :: find all factors of a given number 
Csharp :: check if two timespans intersect c# 
Csharp :: how to write web service for API in c# 
Csharp :: double parse csharp removes decimal 
Csharp :: aspx receive variable from url 
Csharp :: asp.net get most recent file in directory 
Csharp :: how to do that a objetct moves in c# 
Csharp :: linq from list c# 
Csharp :: moq set delay to return 
Csharp :: unity rigidbody freeze rotation y z 
Csharp :: exe path c# 
Csharp :: declarar lista c# 
Csharp :: unity rollaball 
Csharp :: c# progress bar timer 
Csharp :: asp.net c# get user email address from AD 
Csharp :: c# if statement no braces 
Csharp :: c# trimend substring 
Csharp :: c# max sequence contains no elements 
Csharp :: DataGridView ComboBox column selection changed event 
Csharp :: c# in equivalent 
Csharp :: c# check that value is not null or 0 
Csharp :: linq select to list 
Csharp :: c# for loops 
Csharp :: c# list to observablecollection 
Csharp :: c# square symbol 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =