D
D
Denis2014-09-23 01:09:13
css
Denis, 2014-09-23 01:09:13

SelectedItemBinding for DataGridComboBoxColumn becomes null when switching between tabs?

Hello.
I observe very strange behavior and I can not understand what is the reason.
There is a TabControl with two tabs, one of them has a grid with a DataGridComboBoxColumn.

<DataGridComboBoxColumn Header="Цель" MinWidth="100"                                                                     
ItemsSource="{Binding Values}"
SelectedItemBinding="{Binding Value, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"/>

When this tab is opened, the grid is filled correctly, i.e. there are values ​​in the DataGridComboBoxColumn cells, if you switch to the second tab, and then return back, all values ​​are empty.
Some write that it is necessary to use
<Setter Property="IsSynchronizedWithCurrentItem" Value="True"/>

but it didn't help me.
Very strange behavior, how to solve the problem?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
D
Dmitry, 2016-09-24
@LebedevStr

Of course, xs, but why not just flex?)
Yyyy

N
nepster-web, 2016-09-24
@nepster-web

https://jsfiddle.net/9gdL9oum/3/

I
iBird Rose, 2016-09-24
@iiiBird

Well, you fixed the picture. and who will align the text also on middle?
https://jsfiddle.net/9gdL9oum/4/

P
Pavel, 2016-09-24
@mrusklon

img {margin-top: -5px;}

N
Neyury, 2016-09-24
@Neyury

A complete guide to centering (both horizontally and vertically)

S
Sergey, 2016-09-25
@void01

position:absolute;
top:50%;
transform:translateY(-50%);
the parent has position: relative, respectively,
and the adjacent element has margin-left: the image width

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question