检查从数据库中检索值的单选按钮。 [英] check radio button on retrieving the value from database.

查看:147
本文介绍了检查从数据库中检索值的单选按钮。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



在我的applcation中我遇到了问题。我正在从数据库中检索用户付款并根据我要检查现金支票单选按钮已选中。如果用户已通过现金付款,那么当我从数据库中检索用户信息时,我想显示现金单选按钮已选中。如何我这样做。



提前感谢

hello

In my applcation i having a problem. I am retrieving user payment from database and according to that i want to check the cash cheque radio button checked.If user has done payment through cash then when i am retrieving user information from database the i want to show cash radio button checked.How can i do this.

thanks in advance

推荐答案

如果你使用的是Gridview,你可以这样做通过在
If you are using Gridview, you can do this by implementing your code in
GridView1_RowDataBound(...)

功能



在这里找到您的控件:

function

find your control here:

CheckBox chk = (CheckBox)e.Row.Cells[0].FindControl("chk1");





根据您的条件选中复选框属性为true:



Put the checkbox property checked true based on your condition:

if (e.Row.Cells[1].Text.ToString() == "Yes")
{
    chk.Checked = true;
}


这篇关于检查从数据库中检索值的单选按钮。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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