如何在GridView中显示是或否 [英] How to display Yes or no in gridview

查看:87
本文介绍了如何在GridView中显示是或否的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.

我正在C#Windows应用程序中工作,在该应用程序中,我的gridview的一列包含bool值.我需要在gridview中的复选框中显示yes/no.

Hi.

I am working in C# windows application in which i have gridview having one column that contains bool value.I need to show yes/no in place of check boxes in gridview.

推荐答案

引用:
http://dailydotnettips.com/2011/01/19/how-to-display-yes-or-no-instead-of-checkbox-while-binding-boolean-value-with-gridview/ [ ^ ]
Refer :
http://dailydotnettips.com/2011/01/19/how-to-display-yes-or-no-instead-of-checkbox-while-binding-boolean-value-with-gridview/[^]


1.将bool值分配给gridview中的列.
2.在gridview rowdatabound中找到该列
例如e.Row.FindControl("label");
3.检查标签并根据该值将值设置为true false
1.assign bool value to column in gridview.
2.In gridview rowdatabound find that column
e.g e.Row.FindControl("label");
3.check label & set value to true false according to that


这篇关于如何在GridView中显示是或否的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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