web developer tips (53):在vs的设计视图编辑gridview的模板

原文地址:How to edit the templates for gridview in VS designer

通过模板的呈现,可以灵活地配置Gridview控件。下面的步骤将显示在Visual Studio 的设计视图如何编辑gridview的模板(template)

http://www.watch-life.net/visual-studio/edit-the-templates-for-gridview-in-vs-designer.html

1、这里 GridView链接到了一个数据源Sqldatasource:Northwind.products,在配置sql 数据源时,选择“生成插入”、“更新”、“删除”语句。

image

image

2、单击gridview的智能任务(gridview 任务)标签,选中“启用编辑”项。
image

3、在字段列表选择一列名,单击“将此字段转换成TemplateField ”,单击“确定”
image

4、在“gridview 任务”标签选择“编辑模板”
image

5、从下拉框中选择“EditItemTemplate”
image

6、你将看到如下内容
image

7、现在你可以更新模板了,比如你可以拖拽一个requireFiledValidator控件放置其中。
image

8、如果有多个列转换成模板,你可以选择特定的模板列进行编辑。
image

9、切换到“源视图”,你会发现有关模板的改变Visual Studio已经产生了源代码。

image

10、单击“结束模板编辑”退出对模板的编辑。
image

 

更多文章见:守望轩[http://www.watch-life.net/]

posted on 2009-10-12 22:27  xjb  阅读(324)  评论(0编辑  收藏  举报

导航