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);
}
我想还有好多其它方法可以做到这一点.
这种法子还有一个缺点是,它得高度不知道怎么弄,我测试了一下,目前还没有发现在什么问题。
查看全文
相关阅读:
Linux nfs服务讲解
Linux nfs服务介绍
牛客网题目-数组中只出现1次的数字
牛客网中矩阵中的路径
求链表的第一个公共节点
C++中STL中简单的Vector的实现
牛客网栈的压入,和弹出序列
C++智能指针
CI Weekly #22 | flow.ci 新版 iOS 构建流程的 4 大变化
CI Weekly #21 | iOS 持续集成快速入门指南
原文地址:https://www.cnblogs.com/xiaotuni/p/2365763.html
最新文章
composer 使用详解
mysql 5.7 忘记root密码解决方法
git 提交代码到github错误处理
Can't connect to local MySQL server through socket '/tmp/mysql.sock'
Starting MySQL... ERROR! The server quit without updating PID file 解决办法
Table 'performance_schema.session_variables' doesn't exist
在libuv中使用openssl建立ssl连接
redis源码分析(3)sds
php浮点数计算比较及取整不准确解决方法
php 防止表单重复提交
热门文章
php 加载字体 并保存成图片
PHP 7.0 升级备注
10款PHP开源网店系统
PHP Session可能会引起并发问题
分析和解析PHP代码的7大工具
2015 PHP框架调查结果出炉,Laravel最受欢迎!
PHP vs Node.js
2015 PHP框架调查结果出炉,Laravel最受欢迎!
二叉树遍历汇总
手写字符串的全排列
Copyright © 2011-2022 走看看