在gridview中插入 [英] Insert in gridview

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

问题描述

HI
如何在运行时在gridview中插入数据?


谢谢:rose:

HI
How to insert data in gridview on runtime ?


thank''s:rose:

推荐答案

要在运行时插入新的数据行,请遵循 Mohd的帖子.




用新数据填充GridView-使用 DataSource 然后使用 DataBind .

要更新或刷新当前数据源,只需再次 DataBind .

To insert a new row of data @ runtime then follow Mohd''s post.




Populating the GridView with new data - use DataSource then DataBind.

To update or refresh your current datasource then just DataBind again.

GridView1.DataSource = "DataObject"
GridView1.DataBind()






如果要在运行时添加新的GridView,则最好的方法是使用 PlaceHolder 控件.






If you wanting to add a new GridView at runtime then the best way would be to have a PlaceHolder control available.

var gridView = new GridView();
gridView.DataSource = "DataObject";
gridView.DataBind();

Placeholder1.Controls.Add(gridView);


http://www. c-sharpcorner.com/UploadFile/Art%20Scott/GridViewInsertANewRow09012006165053PM/GridViewInsertANewRow.aspx

^

转到这些链接
http://www.c-sharpcorner.com/UploadFile/Art%20Scott/GridViewInsertANewRow09012006165053PM/GridViewInsertANewRow.aspx

^

Go to these links


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

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