I have a gridview which displays data from a database.
Everything works fine, the thing is that I haven't come with a method to do the next thing:
The gridview displays something like this:
Client - Total - Percentage
Ex1 1000 20%
Ex2 2000 40%
Ex3 1000 20%
Ex4 500 10%
Ex5 500 10%
This data might vary depending on the month selected etc etc....
What I want to do is that the gridview kind of check its rows and start summing the percentaje, when it sums 80% I want to color the rows that sum the 80% to one specific color then the rest of the rows leave them with the default color or change it too.
I'm thinking that I might be able to do that with the row data bound event, but I just can't find the answer to do it, I know how to iterate through the rows to sum the values but then how I can tell it to stop if it reaches 80% and color the rows that completed that 80%.
Another thing, the rows that complete this 80% of course have to be the ones with the greatest percentages. In the example above it would be Ex1, Ex2, Ex3. That 80% percent can
View Complete Post