zoukankan
html css js c++ java
GridView中如何取得隐藏列的值?
直接对 <asp:BoundField 隐藏列取值不行,改用模板列实现
<
asp:TemplateField
Visible
="false"
>
<
ItemTemplate
>
<
asp:label
ID
="lblTask"
runat
="server"
Text
='<%#
Eval("task_status") %
>
' />
</
ItemTemplate
>
</
asp:TemplateField
>
然后,
protected
void
SmartGrid_RowDataBound(
object
sender, GridViewRowEventArgs e)
{
if
(e.Row.RowType
==
DataControlRowType.DataRow)
{
switch
(((Label)e.Row.FindControl(
"
lblTask
"
)).Text)
{
case
"
0
"
:
e.Row.CssClass
=
"
color_task_init
"
;
break
;
case
"
1
"
:
e.Row.CssClass
=
"
color_task_back
"
;
break
;
case
"
2
"
:
e.Row.CssClass
=
"
color_task_wait
"
;
break
;
case
"
3
"
:
e.Row.CssClass
=
"
color_task_confirm
"
;
break
;
case
"
4
"
:
e.Row.CssClass
=
"
color_task_finish
"
;
break
;
case
"
10
"
:
e.Row.CssClass
=
"
color_task_cancel
"
;
break
;
case
"
"
:
e.Row.CssClass
=
"
color_terminal
"
;
break
;
default
:
e.Row.CssClass
=
"
color_terminal
"
;
break
;
}
}
}
查看全文
相关阅读:
Codeforces Round #336 B
Codeforces Round #336 A
hiho一下157
Codeforces Round #420 E
Codeforces Round #420 C
Codeforces Round #420 B
Codeforces Round #420 A
Codeforces Round #418 C
Codeforces Round #418 B
CodeForces 811D Vladik and Favorite Game bfs,模拟
原文地址:https://www.cnblogs.com/silva/p/874403.html
最新文章
bzoj 2748
codeforces Testing Round #12
hdu 6092
hdu 6090
hdu 6095
hihocoder 1546
hdu 6069
hdu 6058
hdu 6060 RXD and dividing
2015 HIAST Collegiate Programming Contest B
热门文章
2015 HIAST Collegiate Programming Contest A
2016-2017 ACM-ICPC, NEERC, Central Subregional Contest C
2016-2017 ACM-ICPC, NEERC, Central Subregional Contest H
2016-2017 ACM-ICPC, NEERC, Central Subregional Contest G
2016-2017 ACM-ICPC, NEERC, Central Subregional Contest E
2016-2017 ACM-ICPC, NEERC, Central Subregional Contest F
2016-2017 ACM-ICPC, NEERC, Central Subregional Contest D
2016-2017 ACM-ICPC, NEERC, Central Subregional Contest A
hihocoder 1498
Codeforces Round #336 C
Copyright © 2011-2022 走看看