DataView,Repeater,模板
来源:互联网 发布:linux 命令行图形界面 编辑:程序博客网 时间:2024/05/21 17:37
1.DataView 的作用
可以公开表中具有不同的排序顺序的数据
mydv.Sort=" fbane Asc,fid Asc"
可以按行状或基于筛选器表达式来筛选数据
mydv/RowFilter=" num>100"
设置背景:
if(e.Row.Rowtype==DataControlRowType.DataRow)
{
e.Row.Attributes.add("onmouseover","currentcol=this.style.background='#coc0ff';this.style.cursor='hand'")
e.Row.Attributes.add("onmouseover","currentcol=this.style.background='#cocfff';this.style.cursor='hand'")
}
设置单元格的背景色:
e.Row.Cells[0]. BackColor=System.Drwaing.Color.Red;
2.DataGrid 读取xml中的数据
FileStream fs=new FileStream (Server.MapPath("Student.xml"),FileMode.Open,FileAccess.Read);//文件流
StreamReader st=new StreamReader (fs);//基于文件流读取纯文本(xml就是纯文本)
DataSet set=new DataSet ();
set.ReadXml(st); //将xml数据读入dataset中形成一个表
this.GridView1.DataSource=set;
this.GridView1.DataBind();
3.可绑定的数据类型
简单属性
<%# Textname.text%> 绑定表达式 服务端运行
集合
表达式
方法调用结果
4.模板(注意运用于DataGrid,DataList,Repeater)
设置属性 ,使用样式
模板是一组html元素和控件,他们构成组件特定部分的布局
Repeater(循环显示数据)
支持的模板 ItemTemplate(项) , Alternatingitemtemplate(交替),Headertemplate
Footertemplate,Separatortemplate(分割)
- DataView,Repeater,模板
- 使用Repeater模板一
- 使用Repeater模板 二
- Repeater控件的模板
- 动态创建Repeater模板
- Dataview
- Dataview
- DataView
- DataView
- DataView
- DataView
- Dataview
- Dataview
- DataView
- dataview
- DataView
- DataView
- DataView
- EJB3.0入门经典(笔记) - 第2章 EJB知识与运行环境设置(1)
- C++中回调(CallBack)的使用方法
- Fedora桌面特效快捷键
- [新闻]多点触摸技术手册中文版今日零时发布
- vc中将一个独立的dll(exe),作为资源加入资源文件中
- DataView,Repeater,模板
- Powershell之HelloWorld 脚本入门
- 软件开发交流平台
- 成功的十个习惯
- 信息处理基本原理-设计5
- 努力奋斗的感觉
- Ubuntu 8.04 安装 友善之臂 最新qtopia2.2.0代码
- Android下的OpenGl ES
- VC++动态链接库编程之DLL典型实例