Hi, we have very strange GridViewComboBoxColumn's behaviour. Code is very simple, but we have different result when execute our program on different PC. Normal behaviour should be next:
1) select any item in 3rd row combobox;
2) choose second cell in this row.
3) selected item in 1st column should be selected!!!
But on 50% PC we don't have this, i.e. selected item pull down everywhere. We lose selected item on LostFocus. In debug mode we saw, that debugger comes to GET of Employee.Name property after ComboBox selection changed (on the PC with wrong behaviour). And debugger comes to SET of this property on the PC with normal behaviour. It's hard to believe and to explain. What's wrong with this control?
BUT !!! We don't have any trouble if use common template with ComboBox (i.e. without using GridViewComboBoxColumn) - ex.code3.
Ex.code1: Main Window XAML:
Ex.code2: Main window C#:
Ex.code3: Working template XAML:
1) select any item in 3rd row combobox;
2) choose second cell in this row.
3) selected item in 1st column should be selected!!!
But on 50% PC we don't have this, i.e. selected item pull down everywhere. We lose selected item on LostFocus. In debug mode we saw, that debugger comes to GET of Employee.Name property after ComboBox selection changed (on the PC with wrong behaviour). And debugger comes to SET of this property on the PC with normal behaviour. It's hard to believe and to explain. What's wrong with this control?
BUT !!! We don't have any trouble if use common template with ComboBox (i.e. without using GridViewComboBoxColumn) - ex.code3.
Ex.code1: Main Window XAML:
<
telerik:RadGridView
Name
=
"dGrid"
AutoGenerateColumns
=
"False"
Height
=
"188"
VerticalAlignment
=
"Top"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewComboBoxColumn
ItemsSourceBinding
=
"{Binding Path=Names, Mode=TwoWay}"
DataMemberBinding
=
"{Binding Path=Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
UniqueName
=
"ClmNames"
>
</
telerik:GridViewComboBoxColumn
>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Path=Name, Mode=TwoWay}"
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
Ex.code2: Main window C#:
public
MainWindow()
{
InitializeComponent();
_employees =
new
List<Employee>(){
new
Employee {Names =
new
List<
string
>{
"Ann"
,
"Nata"
}, Name =
"Ann"
},
new
Employee {Names =
new
List<
string
>{
"Elise"
,
"Ivan"
,
"Марк"
}, Name =
"Ivan"
},
new
Employee {Names =
new
List<
string
>{
"Elise"
,
"Ivan"
,
"Марк"
}},
};
dGrid.ItemsSource = _employees;
}
Ex.code3: Working template XAML:
<
telerik:GridViewDataColumn.CellTemplate
><
br
>
<
DataTemplate
><
br
>
<
ComboBox
ItemsSource
=
"{Binding Path=ImprovementList}"
DisplayMemberPath
=
"refimprovement.name_full"
<br>
SelectedItem="{Binding Path=RecalcManualItem.cfaccimprovementlist, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"<
br
>
SelectionChanged="ComboBox_SelectionChanged" /><
br
>
</
DataTemplate
><
br
>
</
telerik:GridViewDataColumn.CellTemplate
>