datagridcomboboxcolumn

wpf datagrid combobox column

末鹿安然 提交于 2019-11-26 23:23:23
问题 I have trouble reading the field. I have tried in different ways but still can not. I want to read the value that the user selected the following 3 values. Code in XAML <DataGridComboBoxColumn X:Name="dgcbc" Header="Wynik"/> Code in C # List<string> list = new List <string> (); lista.Add ("Prize"); lista.Add ("Draw"); lista.Add ("Lost"); dgcbc.ItemsSource = list; 回答1: This sample might help you in understanding how listbox can be used. public class Employee { public string Name { get; set; }

Problem binding DataGridComboBoxColumn.ItemsSource

时光总嘲笑我的痴心妄想 提交于 2019-11-26 14:17:16
问题 I have 3 tables: Item - which is the DataContext - it has a navigation column Group Group - has a navigation column Category. I want to have in the DataGrid both (Category & Group) columns and when I choose a category it should display in the group col only the Category.Groups. Here is the code I am working on: <tk:DataGrid AutoGenerateColumns="False" ItemsSource="{Binding}"> <tk:DataGrid.Columns> <!--Works--> <tk:DataGridComboBoxColumn Header="Categroy" DisplayMemberPath="Title"

Binding ItemsSource of a ComboBoxColumn in WPF DataGrid

倖福魔咒の 提交于 2019-11-26 00:37:31
问题 I have two simple Model classes and a ViewModel... public class GridItem { public string Name { get; set; } public int CompanyID { get; set; } } public class CompanyItem { public int ID { get; set; } public string Name { get; set; } } public class ViewModel { public ViewModel() { GridItems = new ObservableCollection<GridItem>() { new GridItem() { Name = \"Jim\", CompanyID = 1 } }; CompanyItems = new ObservableCollection<CompanyItem>() { new CompanyItem() { ID = 1, Name = \"Company 1\" }, new