如何将值设置为gridview模板列? [英] How to set value into a gridview template column?

查看:107
本文介绍了如何将值设置为gridview模板列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在网页中有一个gridview和一个文本框.
前两列"ID"和"Item"是从SQL数据库绑定的,最后一列是作为模板列的条形码".
我希望条形码一栏一栏地填写文本框中的值.
填写完所有条形码后,它将被更新到数据库.
是否可以将值设置到gridview中,而不是从数据库中绑定?
顺便说一句,如果您知道如何做,请在VB中回复.

谢谢

Hi,

I have a gridview and a textbox in a web page.
The first 2 columns "ID" and "Item" are binding from SQL database and the last one is "Barcode" which is a template column.
I''d like the Barcode column to be filled in values from textbox one by one.
After all Barcode coulmns are filled in, then it will be updated to database.
Is that possible to set values into gridview, not binding from database?
BTW, if you know how to do it, please reply in VB.

Thanks

推荐答案

>
andyhcc写道:
andyhcc wrote:

是否可以将值设置为gridview,无法从数据库绑定?

Is that possible to set values into gridview, not binding from database?


是的,有可能.设置AutoGenerateColumns ="false",然后在代码中将所需的列绑定到从数据库返回的特定字段.



Yes it is possible. Set AutoGenerateColumns="false" and then in your code bind the columns that you want to a specific field returned from the database.


andyhcc写道:
andyhcc wrote:

我希望条码栏一一填写文本框中的值.

I''d like the Barcode column to be filled in values from textbox one by one.


您已经将其设置为模板列,现在,完成所有填充,发生保存事件,捕获这些文本框中的值并将其保存在数据库中.


You already made it a template column, now once you filled all, have save event, capture the values in those textboxes and save it in the database.


这篇关于如何将值设置为gridview模板列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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