Search a gridview and change the item color if found in a query result
Posted on 2007-12-06
I have been struggling with this and am frustrated that it isn't easier (or I am not smarter).
What I am trying to accomplish is I have a page of fixed items that I want to vary the color if they show up in a SQL query. I have tried a datalist and now using several gridviews to post the data into.
SHELF1 SHELF2 SHELF3 <--- These are individual gridviews (shelf1, shelf2, etc)
ABC DEF GHI
JKL MNO QRP
When I click a button I will execute a SQL query to a database and if any of the results contain an item in any of the gridviews it will change the item's cell color so as to indicate a match. So I need to loop through each gridview and if there is a match then color, if not then move to the next gridview.
This sounds so simple but not sure if the way I have laid it out will work. I had to break this down into multiple gridviews since I do not want a single column with over 60 rows. And when I tried a dataview someone told me I could not change the item color.
This is webforms, VB 2005