zoukankan
html css js c++ java
hashtable 绑定的datagrid
cs code
protected
System.Web.UI.WebControls.DataList datalist;
Hashtable o
=
new
Hashtable();
private
void
Page_Load(
object
sender, System.EventArgs e)
{
DataTable dt
=
new
DataTable();
dt.Columns.Add(
"
saf
"
);
DataRow dr
=
dt.NewRow();
dr[
0
]
=
"
todd ha ha
"
;
dt.Rows.Add(dr);
dr
=
dt.NewRow();
dr[
0
]
=
"
summy ha ha
"
;
dt.Rows.Add(dr);
o.Add(
1
,dt);
o.Add(
2
,dt);
o.Add(
3
,dt);
this
.datalist.DataSource
=
o;
this
.datalist.DataBind();
}
private
void
datalist_ItemDataBound(
object
sender, System.Web.UI.WebControls.DataListItemEventArgs e)
{
DataGrid obj
=
((DataGrid)(e.Item.FindControl(
"
datagridtest
"
)));
//
object objItem = this.datalist.DataKeys[e.Item.ItemIndex];
System.Collections.DictionaryEntry Entity
=
(System.Collections.DictionaryEntry)(e.Item.DataItem);
DataTable bb
=
((DataTable)(Entity.Value));
obj.DataSource
=
bb;
obj.DataBind();
}
aspx code
<
asp:DataList
ID
="datalist"
Runat
="server"
DataKeyField
="key"
>
<
ItemTemplate
>
<
asp:Label
ID
="labeltest"
Runat
=server
text
='<%#
DataBinder.Eval(Container, "DataItem.key")%
>
' >
</
asp:Label
>
<
asp:DataGrid
ID
="datagridtest"
Runat
=server
></
asp:DataGrid
>
</
ItemTemplate
>
</
asp:DataList
>
查看全文
相关阅读:
IIS发布问题解决
创建Core项目使用IdentityServer4
通过数据库名称字符串 反射获取数据并刷新对应缓存
MVC模式下unity配置,报错“No connection string named '**Context' could be found in the application config file”
Docker巨轮的航行之路-基础知识篇
C#之LINQ
Js调试中不得不知的Console
jQuery中是事件绑定方式--on、bind、live、delegate
前端常用技术概述--Less、typescript与webpack
ES6学习之变量的解构赋值
原文地址:https://www.cnblogs.com/snowball/p/461406.html
最新文章
AspNetCore3.1_Secutiry源码解析_3_Authentication_Cookies
AspNetCore3.1_Secutiry源码解析_2_Authentication_核心对象
AspNetCore3.1_Secutiry源码解析_1_目录
AspNetCore3.1_Middleware源码解析_3_HttpsRedirection
AspNetCore3.1_Middleware源码解析_2_Hsts中间件
AspNetCore3.1_Middleware源码解析_1_CORS中间件
2构建个人博客--使用Webhook自动发布
1构建个人博客--使用Hugo快速成型
CentOS7下使用SonatypeNexus3搭建Docker私有仓库
EasyOffice-.NetCore一行代码导入导出Excel,生成Word
热门文章
MySQL跟踪SQL&慢查询分析工具
.Net Core下基于NPOI对Excel、Word操作封装
利用表达式树Expression优化反射性能
.Net Core WebApi返回日期格式的问题
记录一下阿里云的学习资料,方便下次查阅
C#的中stopwatch的简单应用
Netcore发布程序到树莓派,开机启动及远程方法
Web Deploy远程部署验证不通过的几个个人原因
.net Core项目发布到Docker for Windows
为Visual Studio安装其他控件(cognex 康耐视)时报错:未能加载文件或程序集 EnvDTE, Version=8.0.0.0
Copyright © 2011-2022 走看看