动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
  
   .Net → 阅读文章

 BoundColumn

作者来源: 
阅读 数 672 人次 , 2006-3-29 4:30:00 


boundcolumn 最主要的功能是利用label 来显示数据源中的一个字段内容,其使用语法如下所示:

<asp:boundcolumn
datafield="datasourcefield"
dataformatstring="formatstring"
footertext="footertext"
headerimageurl="url"
headertext="headertext"
readonly="true | false"
sortfield="datasourcefieldtosortby"
visible="true | false"
footerstyle-property="value"
headerstyle-property="value"
itemstyle-property="value"
/>

其中除了共同基础属性以及样式对象外,常用的属性如下表所示:

下列程序代码片段以boundcolumn 来显示字段内容:

<asp:datagrid id="dga" allowpaging="true" pagesize="5"
onpageindexchanged="dga_pagechg" runat="server"
pagerstyle-mode="numericpages" bordercolor="#808080"
headerstyle-font-names="courier new"
headerstyle-backcolor="#d1dceb"
autogeneratecolumns="false">
<property name="columns">
<asp:boundcolumn
headertext="姓名"
headerstyle-font-bold="true"
headerstyle-horizontalalign="center"
datafield="username"/>
<asp:boundcolumn
headertext="电话"
headerstyle-font-bold="true"
headerstyle-horizontalalign="center"
datafield="usertel"/>
<asp:boundcolumn
headertext="住址"
headerstyle-font-bold="true"
headerstyle-horizontalalign="center"
datafield="useradd"/>
</property>
</asp:datagrid>

 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:ButtonColumn
· 下一篇:自订字段内容
· Cancel、Delete、Edit、Item、Sort、Update 事件的宣告
· ASP.Net+XML打造留言薄
· Calendar Web 控件的事件
· .net中窗体的调整
· 一段实现DataGrid的“编辑”、“取消”功能脚本


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077