URGENT - dynamically change background color of a datagrid row based on database column value
I have a C# WPF PROJECT AND NEED A COMPLETE SOLUTION TO DO THE FOLLOWING.
1. Change the color of a WPF datagrid cell when my sql database query finds a true or a false on specific database columns
2. I need to change the color in the same column/row where the true/false is located.
3. I need to continue to do this as long as the database is being queried.
This request for help is very urgent. Please assist. If you work for hire I will pay as well.
Thanks
C#Databases
Last Comment
Ron McCain
8/22/2022 - Mon
Anil Golamari
Hi,
Below is sample that I have created which should be able to give you working code. But I am not sure about 3 point as I don't have much sample data to insert I just created for 3 rows that I build for this sample.
Also I have used entity framework to make the database connection and fill up the datagrid.
Not sure if the sample db of any use for you but just want to paste it if you want to go through it.
Create Table wpfsample(ID int Primary Key identity(1,1), Name nvarchar(256), Wanttorevealrace Bit); select * from dbo.wpfsampleInsert INTO dbo.wpfsample (Name, Wanttorevealrace) select 'John', 0 Union All select 'Mike', 1 Union All select 'Mat', 0
we tried for quite some time but could get your solution to work. I think it may be my fault in my explanation. would you be willing to look at my code and integrate a working solution. we will be happy to pay for your services if required
What exactly you are looking for? Because I thought I have posted required code above. Send me a message about exactly what you are looking for and I can definitely try to help you out.
Ron McCain
ASKER
As I said I'm sure you sent a good solution we just cant seem to integrate it with what we already have.
We will need to integrate the bindings and triggers with our xaml and xaml.cs code and we will need to use the queried values from our database to trigger the bindings in the xaml file which will color the bound items in the xaml. If you are willing I will send you our files
Ron McCain
ASKER
got your message. i will prepare something and send it . thanks very much
Below is sample that I have created which should be able to give you working code. But I am not sure about 3 point as I don't have much sample data to insert I just created for 3 rows that I build for this sample.
Also I have used entity framework to make the database connection and fill up the datagrid.
Open in new window
Open in new window
Not sure if the sample db of any use for you but just want to paste it if you want to go through it.
Open in new window