Click here to Skip to main content
15,881,820 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am working grid within a grid.

i have a drop downlist.

like in drop down

office1
office2
office3
office4

if i select office1 in dropdown


i get result like

Trip1
office1 office2 office3

10:00 10:40 11:00

Trip2

office2 office3 office1

16:00 16:40 17:00


-----so i when i select office1 from drop down i get two trip list[2 grids get binded with in main grid]....whereever office1 is there it will show the result--------

--till here everything is fine--- now suppose some situation comes like office1 is in 10 places--user wll be confused--- So I was thinkng like if user selects office1....whereever he office1 is there in the grid--the header becomes different color /or highlighted


For Example: in above case[i am showing it as capital letter for office1 ...as i cant highlight here]


CSS
Trip1
OFFICE1 office2 office3

10:00     10:40   11:00

Trip2

office2  office3   OFFICE1

16:00     16:40     17:00


--so the thing is like highlighing header of a gridview column which is selected in dropdown
Posted
Updated 18-Jul-13 3:18am
v3

1 solution

You can do this by RowDataBound event of grid in which you can compare that element is same as DropDownList.SelectedItem ,if it is same the chage the color o/w not.

http://stackoverflow.com/questions/4427848/change-cell-color-on-different-values-gridview[^]
 
Share this answer
 
Comments
anurag19289 18-Jul-13 11:59am    
i will try that tomorrow and get back to you...
Asp_Learner 18-Jul-13 12:50pm    
GridView1.Columns[Your Coloumn Number starting from 0 index].HeaderStyle.BackColor = Color.Blue;

please accept it as answer if this will solve your purpose.

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