有没有办法突出显示gridview特定列的标题 [英] Is there any way to highlight header of particular column of your gridview

查看:115
本文介绍了有没有办法突出显示gridview特定列的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在网格中工作。



i有一个下拉列表。



喜欢下拉



office1

office2

office3

office4



如果我在下拉菜单中选择office1





i获得结果如



Trip1

office1 office2 office3



10:00 10:40 11:00



Trip2



office2 office3 office1


16:00 16:40 17:00





---- - 所以当我从下拉列表中选择office1时,我得到两个行程列表[2个网格在主网格中绑定] ....无论office1在那里它都会显示结果--------



- 这里一切都很好---现在假设有一些情况就像office1在10个地方 - 用户会感到困惑 - 所以我认为如果用户选择office1 ....他办公室1是什么时候在网格中 - 标题变为不同的颜色/或突出显示





例如:在上面的情况下[我显示为office1的大写字母......我不能在这里突出显示]





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]


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

推荐答案

你可以通过网格的RowDataBound事件来做到这一点你可以在其中比较该元素与DropDownList.SelectedItem相同,如果它是相同的颜色o / w没有。



http://stackoverflow.com/questions/4427848/change- cell-color-on-different-values-gridview [ ^ ]
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[^]


这篇关于有没有办法突出显示gridview特定列的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆