GridView中的模板. [英] Template in GridView.

查看:103
本文介绍了GridView中的模板.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我在ASP.Net中创建了一个具有模板字段的网格视图,我将数据从网格视图保存到数据库中,但是如何在模板字段中将保存的数据检索到网格视图中呢?因为在数据字段中没有选项.

请做有需要的人.

谢谢
Basit.

Dear All,

I created a grid view in ASP.Net which has a template field, i save the data from grid view into the database, but how can i retrieve the save data into the grid view becoz in template field no option for data field.

Please do the needful.

Thanks
Basit.

推荐答案

但是我如何在模板字段中将保存的数据检索到网格视图中,因为数据字段中没有选项.
数据保存到现场后,为什么还要担心网格?您在数据库中有带有列和行的表.通过查询使用ADO.NET获取数据.

如果您想将数据表列绑定到具有模板字段的网格,请参见:
MSDN:在GridView控件中使用TemplateFields [ MSDN:在GridView Web服务器控件中创建自定义列 [ MSDN:TemplateField.ItemTemplate属性 [ ^ ]
but how can i retrieve the save data into the grid view becoz in template field no option for data field.
Once data is saved in field, why do you worry of grid? You have table with columns and rows in database. Fetch the data using ADO.NET using some query.

In case, you want to bind a datatable column to grid having template fields, see this:
MSDN: Using TemplateFields in the GridView Control[^]
MSDN: Creating a Custom Column in a GridView Web Server Control[^]
MSDN: TemplateField.ItemTemplate Property[^]


这篇关于GridView中的模板.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆