在Gridview中添加项目 [英] Add items in Gridview

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

问题描述

大家好,

谁能教我如何在语法上添加项目
ASP.NET上的datagridview.
因为我的代码是台式机应用程序,例如"Datagridview1.rows.add..etc"无法正常工作.
我希望所有项目都首先添加到datagridview
然后,如果用户完成了将所有项目添加到Gridview中的操作
用户可以轻松单击保存"按钮.
在这种情况下,我将执行一些在Gridview项目内循环的代码.
保存到其相应​​的数据库.

我在ASP中使用Visual Basic

非常感谢,
Ping.

Hi all ,

Can any one teach me how to add item pro grammatically in
datagridview at ASP.NET.
Because my Code is Desktop apps like " Datagridview1.rows.add..etc " not Working.
I want all Items will be added first in datagridview
then if the user finish to add all items in Gridview
the user is easily click the Save Button.
in that case i will do Some Code that loop inside Gridview item.
that save to their corresponding Database.

I use Visual Basic in ASP

Many Thanks,
Ping.

推荐答案



您不能像Windows应用程序的DataGridView一样在GridView中添加行
您可以使用两种方法在GridView中添加行
1)将所有记录从表输入到DataTable并将其绑定到GridView
2)当您想在GridView中添加新行时,首先在Datatable中获取所有行,然后在DataTable中添加新行后在DataTable中添加新行,将此数据表绑定到GridView

希望现在一切都清楚了
祝你好运
快乐编码:)
Hi,

you can not add rows in GridView like DataGridView of Windows Application
to you Can Add Row In GridView Using Two Ways
1) get all Records from Tables In to DataTable and Bind this to GridView
2) when u want to add new Row in GridView then First get All Rows in Datatable then Add new Row in DataTable after adding new Row in DataTable bind this Datatable to GridView

Hope all things are clear now
Best Luck
Happy Coding:)


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

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