如何根据数据库表更改gridview下拉列表的选定值 [英] How to change the selected value of a dropdown list of a gridview based on database table

查看:91
本文介绍了如何根据数据库表更改gridview下拉列表的选定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在我的程序中使用gridview,它有5列。前三列有下拉列表(每个下拉列表有2个值P,A)。其他两列有studentRollNo和Name。

我将数据从sql server表绑定到网格视图。最初选择的所有下拉值都是P。

但是,如果记录已经存在于数据库表中,那么根据该记录我的下拉选择值应该改变,否则它应该是P 只有。



先谢谢你为我带来痛苦。

Hello,
I am using a gridview in my program, which has 5 columns. First three columns has dropdown lists ( Each dropdown list has 2 values "P", "A").The other two columns have studentRollNo and Name.
I am binding the data from a sql server table to gridview. Initially all the dropdowns selected value is "P".
But, If the record is already present in database table, then according to that record my dropdown selected value should be change or else it should be "P" only.

Thanks in advance for taking pain for me.

推荐答案

Hi 2012programmer,



请尝试使用以下链接获取解决方案。



http://forums.asp.net/t/1508054.aspx/1 [ ^ ]



谢谢,

Vamsi
Hi 2012programmer,

Try the below link for solution.

http://forums.asp.net/t/1508054.aspx/1[^]

Thank you,
Vamsi


这篇关于如何根据数据库表更改gridview下拉列表的选定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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