Setting Grid Properties

Is it possible to set grid properties through triggers?

Currently when I’m looking at a DataTrigger for a Label and going through the Setters dialogue, I can’t find the properties for Grid.Column or Grid.Row. Depending on the the binding value, I’d like to be able to move which Row my object is in.

Also, I see that I can set Triggers to the Grid Control ColumnDefinitions and RowDefinitions, but what would the Value look like to set the properties? (Row Height? IsEnabled?)

Thanks!

Most properties can be set by triggers however Grid.Column & Grid.Row cannot. They can only be set during design time.

You can update RowDefinition & ColumnDefinitions with triggers. You just need to give them a name. It’s not RowHeight, it’s Height. Set the Height property with the desired value. The CameraDetails.xaml file actually updates several RowDefinitions with triggers. Take a look at what the maximize & minimize buttons are doing in that template.

Can this only be done with Event Triggers?

I named my Rows in the RowDefinitions dialog, but they do not show up in the Data Trigger Setters box. (It only shows RowDefinitions as an available Property)

I think I found I can accomplish what I want by using the Event Trigger and setting the Conditions to my Data Trigger.

For the Grid Row or Column property of IsEnabled, what is the Value for True and False? 0,1,False,True, etc.? I’ve tried a few combinations and it doesn’t seem to be reacting.

Thanks!

It’s a boolean so it’s True or False. But I’m pretty sure IsEnabled doesn’t do anything for RowDefinitions & ColumnDefinitions. That’s just an inherited property.