© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
19 replies
mblla

❔ Illuminate buttons pressing a row of a DataGrid

Hello! I have a bigger project but to resolve a question I made another one, as an example to show the behavior I want my application to have, continue as follows.
I have a People model with basic properties (name, age, and a random boolean) As I am using the MVVM design pattern I am passing a list of People, "previously created in the ViewModel", to a DataGrid that has 2 columns Name and age, and below some buttons, "The behavior I want it to have is that, while I select a row of the datagrid, the buttons change color depending on the boolean of my object passed by list"

(Be careful, the behavior does not make much sense, but I would like to do this for another personal project)

I have searched for Chat Gpt, and it has given me a solution with triggers, but it has not worked for me.

If anyone could help me, I'd be grateful.
People.png
ViewModel.png
TheXamlPart.png
TheUIApp.png
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

DataGrid Cell Selection / Row Color
C#CC# / help
2y ago
❔ DataGridView Buttons
C#CC# / help
4y ago
✅ Change dataGridRow:selected row
C#CC# / help
12mo ago
✅ How can I use a row header of a datagridview to display the row number instead of being empty?
C#CC# / help
4y ago