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);
}
我想还有好多其它方法可以做到这一点.
这种法子还有一个缺点是,它得高度不知道怎么弄,我测试了一下,目前还没有发现在什么问题。
查看全文
相关阅读:
springboot集成Spring Security安全框架(一)入门程序
Redis学习(三)Redis 配置
javax.servlet.ServletException: Could not resolve view with name 'order/list' in servlet with name 'dispatcherServlet'
com.mysql.cj.exceptions.DataReadException: Zero date value prohibited
Redis学习(二)Redis的安装
Redis学习(一)简介
Registering current configuration as safe fallback point
IntelliJ IDEA为类和方法自动添加注释
github 创建新项目
pypi 的使用
原文地址:https://www.cnblogs.com/xiaotuni/p/2365763.html
最新文章
gl.h报错
编译osgEarth2.8遇到gdal_vrt.h找不到的问题
devstack两次以上重装提高成功率的方法
How to mount a NFS share?
Discovering versions from the identity service failed when creating the password plugin.
DevStack安装时报“download of get-pip.py failed”
共享存储
nova 虚拟机迁移
devstack meaning of: n-cond, n-novnc and n-xvnc
devstack查看服务日志
热门文章
haproxy simple cfg
Struts2请求流程图
姓名分析
Java Servlet/JSP容器配置 session id
Eclipse Jetty Integration
maven添加额外archetype
匿名内部类 , Iterable<T> 和 Iterator<T>
C#多线程方法同步
Intellij IDEA中分屏显示方法
在.xml文件中模糊查询的常用的3种方法
Copyright © 2011-2022 走看看