zoukankan
html css js c++ java
GridView 隐藏某中得些列.并在HeadText上显示相关的信息
private
void
ShowInformation()
...
{
DataTable dt
=
oss.GetOutStoreSearchResult(oss);
bb
=
this
.gvOutStore.ControlStyle.Height;
if
(dt.Rows.Count
==
0
)
...
{
AddDummyData(dt);
//
如果没有数据时,添加一列空值
for
(
int
i
=
1
; i
<
gvOutStore.Columns.Count; i
++
)
...
{
this
.gvOutStore.Columns[i].Visible
=
false
;
//
这个是把除第一列以外得所有列都隐藏起来
}
this
.gvOutStore.Columns[
0
].HeaderText
=
"
显示标题。<table style="vertical-align: bottom; 100%; text-align: left"><tr><td align="left" >暂无XXXX信息。</td></tr>
"
;
this
.gvOutStore.ControlStyle.Height
=
0
;
this
.hfOutStoreID.Value
=
"
-1
"
;
}
else
...
{
for
(
int
i
=
1
; i
<
gvOutStore.Columns.Count; i
++
)
...
{
this
.gvOutStore.Columns[i].Visible
=
true
;
//
显示所以已经隐藏起来得列.
}
//
this.gvOutStore.ControlStyle.Height = bb;
this
.gvOutStore.Columns[
0
].HeaderText
=
""
;
}
this
.gvOutStore.DataSource
=
dt;
this
.gvOutStore.DataBind();
}
//
如果为空得时候就添加一行空得记录
private
void
AddDummyData(DataTable dt)
...
{
DataRow newRow
=
dt.NewRow();
dt.Rows.Add(newRow);
}
我想还有好多其它方法可以做到这一点.
这种法子还有一个缺点是,它得高度不知道怎么弄,我测试了一下,目前还没有发现在什么问题。
查看全文
相关阅读:
Codeforces 1322B
面向对象案例
0428面向对象2.0
0427 面向对象初识
0427数组相关思想
0426数组操作
Eclipse使用技巧
数组汇总0426
0424数组练习
数组习题练习0424
原文地址:https://www.cnblogs.com/xiaotuni/p/2365763.html
最新文章
Too Many Connections: How to Increase the MySQL Connection Count To Avoid This Problem
DVWA--文件上传
纯手工注入
phpmyadmin拿网站shell
CTF-域渗透--HTTP服务--命令注入2
CTF-域渗透--HTTP服务--命令注入1
CTF-域渗透--HTTP服务--命令执行
CTF-域渗透--HTTP服务--命令执行(使用集成工具测试)
CTF-域渗透--HTTP服务--路径遍历(提升root用户权限)
CTF-域渗透--HTTP服务--路径遍历(拿到www-data用户权限)
热门文章
CTF-域渗透--HTTP服务--暴力破解
模板
Codeforces Global Round 7
模板
牛客挑战赛38
Educational Codeforces Round 7
模板
随机抽出的计算机网络常识(01)
模拟笔试记录
Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics)
Copyright © 2011-2022 走看看