ASP.NET 2.0 中动态添加 GridView 模板列的例子
2009-03-24 12:26
531 查看
动态添加列,关键是实现 ITemplate.InstantiateIn 方法。下面是一个添加 GridView 模板列的例子。
C#代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>GridView动态添加模板列的例子</title>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:BoundField HeaderText="标题" DataField="text"/>
</Columns>
</asp:GridView>
</form>
</body>
</html>
C#代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>GridView动态添加模板列的例子</title>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:BoundField HeaderText="标题" DataField="text"/>
</Columns>
</asp:GridView>
</form>
</body>
</html>
相关文章推荐
- [导入]ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列 以及取值的例子
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列 以及取值的例子
- ASP.NET 2.0 中动态添加 GridView 模板列 以及取值的例子
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列的例子
- ASP.NET 2.0 中动态添加 GridView 模板列 以及取值的例子
- ASP.NET 2.0 中动态添加 GridView 模板列
- asp.net动态添加GridView的模板列,并获取列值
- ASP.NET 2.0中动态添加GridView
- asp.Net中Gridview动态创建模板列