我可以在gridview的同一行中使用boundfield和textbox [英] Can i have boundfield and textbox in the same row of a gridview

查看:106
本文介绍了我可以在gridview的同一行中使用boundfield和textbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp.net网页,我在其中选择学校的特定班级和部门。基于这些值,gridview将加载该类中的学生名称(存储在sql server db中的student表中)。如果我想一次性使用此gridview(批量条目)为每个学生分配测试标记,那么该怎么做。 (我的想法是,第一列作为学生姓名的边界,第二列作为标记的文本框,最后我每行都有一个添加按钮)。



谢谢提前。

i have an asp.net web page, in which i am selecting the specific class and division in school. based on these values the gridview will be loaded with the student names(stored in students table in sql server db) in that class. If i want to assign the marks of a test to every student using this gridview all at a time (bulk entries), then how to do it. ( my idea is like, having first column as boundfield for student names, second column as textbox for marks and lastly i have an add button for each row).

Thanks in advance.

推荐答案

是的,你可以做到。



第一列将是 BoundField ,另一个将是 TemplateField

EditItemTemplate TemplateField ,你将放置你的 TextBox 并且在内部> ItemTemplate 一个标签



标签里面 ItemTemplate 将显示何时 GridView 未处于编辑模式 TextBox EditItemTemplate GridView 处于编辑模式时,将显示c $ c>。



你可以轻松地在 Google 中找到示例。
Yes you can do it.

First Column will be BoundField and other one will be a TemplateField.
Inside EditItemTemplate of TemplateField, you will place your TextBox and inside ItemTemplate one Label.

Label inside ItemTemplate will show when GridView is not in Edit mode and TextBox inside EditItemTemplate will show when GridView is in Edit mode.

You can easily find examples in Google for that.


这篇关于我可以在gridview的同一行中使用boundfield和textbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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