如何根据c#中的值选中复选框 [英] How To Check checked box based on values in c#

查看:93
本文介绍了如何根据c#中的值选中复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..



i有FORM1,因为我有按钮即津贴,一旦我点击了我在动态复选框里面的数据gridview中显示的津贴按钮,我得到的Row值点击复选框



我的问题是如何查看用户点击的值



示例:


$ 1 $ b在Form1用户选择复选框的值如LOAN,一旦用户关闭表单并再次打开意味着我想检查贷款checkBox ...



怎么做...



谢谢!

Hi..

i have FORM1, in that i have button namely allowance , once i click allowance button i displayed with in data gridview inside of dynamic check box, i got the Row values of which clicked on check box

My problem is How to check values which clicked by the User

Example:

in Form1 user choose value of check box like "LOAN", once user close the form and open again means i want to check "LOAN" checkBox...

How to Do it...

Thanks !

推荐答案

Quote:

在Form1用户中选择LOAN复选框的值,一次用户关闭表单并再次打开意味着我想检查LOANcheckBox ...

in Form1 user choose value of check box like "LOAN", once user close the form and open again means i want to check "LOAN" checkBox...



这意味着即使表单关闭,您也必须保持用户选择。例如,您可以创建一个类 UserSelections 并使其成为程序(或父表单)的成员或您可以使用序列化来保存用户在磁盘上的选择。


That means you have to maintain users selections even when the form is closed. You may, for instance create a class UserSelections and make it member of your Program (or of a parent form) or you may use serialization to save user selections on the disk.


<ItemTemplate>
 <asp:CheckBox ID="chkSelect" runat="server" Checked='<%# Convert.ToBoolean(Eval("isapplicable")) %>' />
</ItemTemplate>


Use query to return 1 or 0 for "isloanamount" variable. If isloanamount value is 1 checkbox will be displayed as checked.


这篇关于如何根据c#中的值选中复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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