mblla
mblla
CC#
Created by mblla on 4/12/2023 in #help
❔ 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
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
Now I'm going to try to understand how it works haha, thanks!
20 replies
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
Works!
20 replies
CC#
Created by mblla on 4/12/2023 in #help
❔ 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
CC#
Created by mblla on 4/12/2023 in #help
❔ 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
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
Awesome! I'm gonna try do my self
20 replies
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
The DataGrid receives a list of the People object that has several properties and the IsOk is one of them, it is a boolean, and it does not matter which row is selected, just by selecting a row, it performs the color change
20 replies
CC#
Created by mblla on 4/12/2023 in #help
❔ Illuminate buttons pressing a row of a DataGrid
Change only those that have true in their IsOk property Sorry for my english, I'm translating it
20 replies