mblla
❔ Illuminate buttons pressing a row of a DataGrid
I found a way to do, only with trigers, but only works to change on all button, but, I'm trying to found how can do for one button unique
This is de code in de View
<Window.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="Gray"/>
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=myDataGrid, Path=SelectedItem.IsOK}" Value="True" >
<Setter Property="Background" Value="Green" />
</DataTrigger>
<DataTrigger Binding="{Binding ElementName=myDataGrid, Path=SelectedItem.IsOK}" Value="False" >
<Setter Property="Background" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
20 replies
❔ Illuminate buttons pressing a row of a DataGrid
That's what it told me when I asked ChatGpt, but there were things that it didn't even allow to compile, and I couldn't find a solution. I found this discord by microsoftLearn, while reading documentation about triggers haha
20 replies
❔ Illuminate buttons pressing a row of a DataGrid
What I didn't know was how to pass the list that was sent by binding to the code behind my view to be able to operate, but I couldn't change colors either, I'll try to do it myself, Thank you very much for your time!!
20 replies