I have an WPF application that contains a grid. The grid is split into 3 columns with the 3rd grid having zero width upon loading.
I have two datagrids in the other two
Using the correct DataTrigger
, this is totally possible. First, add the Trigger
to the UI element that you want to change... the ColumnDefinition
, not the Grid
:
Next, don't set the Width
on the ColumnDefinition
element, but in the Style
instead. Otherwise the Width
on the ColumnDefinition
element will override the value set from the DataTrigger
.