I've used Combos inside datagrids a lot and never had any problems but for some reason on this one page it doesn't. When I try to change the entry I get a cellendedit event but the cell stays selected and shows a thin red line around the outside. I can't open any other combobox in the display either. I populate it with an enum converted to an observable list and bind the column to a datatable.
Code:Public Enum ItemTypes As Integer ignore Products Ingredients Consumables Taxation Equipment Utilities Maintenance Rentals Monthly Other Last End EnumCode:Public Function GetSubTypesCollection() As ObservableCollection(Of ItemsClass) Dim col As New ObservableCollection(Of ItemsClass) For i = 4 To ItemTypes.Last - 1 Dim entry As New ItemsClass([Enum].GetName(GetType(ItemTypes), i), i) col.Add(entry) Next Return col End FunctionThe only thing I can think of would be that the selectedvalue is something the datatable doesn't like. I msgbox() the entire collection and made sure it was just integers though (typeid is an integer column too).Code:Dim cbCol = New DataGridComboBoxColumn cbCol.Header = "Type" cbCol.ItemsSource = GetSubTypesCollection() cbCol.DisplayMemberPath = "Name" cbCol.SelectedValuePath = "ID" cbCol.SelectedValueBinding = New Binding("typeid") cbCol.Width = New DataGridLength(1, DataGridLengthUnitType.Star) dg.Columns.Add(cbCol)
Oh the datagrid declaration!
I am about to erase and redo it all but I'm hoping someone can spot my errorCode:<DataGrid Name="dg" Grid.Row="0" Grid.Column="0" IsReadOnly="False" CanUserAddRows="False" CanUserDeleteRows="False" AutoGenerateColumns="False"/>


Reply With Quote