Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi community,

I am developing a Application which has a Datagrid. which will be Cell colored based on the below condition.

1. There will be a status field in the collection binded to the datagrid. which has values ( Passed , Failed , Waiting) for which Passed will be colored as Green, Failed will be Red and Waiting will be Gray.

2. and, there are some more fileds along with Status field namely ExecutionData, EffectiveDate, Source, Destination, Category, Status Detail.

3. my job is to do the below logic

1.To compare each column of the each row and find the different which mean, if ExecutionData (first column) of first row and ExecutionData (First column) of the second row is same i have make the cell color based on the first row status.

2. The next combination would be ExecutionData and EffectiveDate of the both rows should be same. if in any combination in any column differs. from that column all the preceeding column color would be the mismatched second row status color.

3. now comes the main part when comparing with the 3rd row. we should compare with the first column and check for the combination if any cell value differs stop using the parent row color ( first row color) then use the current row ( 3rd row) color. hope all understand the logic of what i was trying to explain. so what i need is this

---------------------------------------------------------------------------------

I have added a grid which will access the DataGridCell Style in the Usercontrol resource which internally calls a color IValueConvertor. now the IValueConvertor which is bounded to the Datacell style get the data row and based on the DataRow (status) field value i am adding the color for the particular cell but the logic what i was working has got strucked when i try to implement the above logic what i explained. The Column comparing thing. so can any one help me arround how to achieve this in WPF datagrid.

Note:

Please let me know if anyone can't understand my Explanation.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900