c# - 如何在gridview绑定中将复选框更改为标签
问题描述
我已经在 gridview 中绑定了该表中的数据库,该表在第 2 列和第 3 列中具有 0 和 1 的布尔值(真或假)。当我得到输出浏览器将显示禁用复选框,如果 true 选中禁用复选框显示,否则禁用复选框显示。我的问题是如果选中的复选框替换了一些图像未选中的复选框替换了 C# 中的一些图像
<asp:GridView ID="gvedition" runat="server" AutoGenerateColumns="True"
CssClass="table table-responsive" OnRowDataBound="gvedition_RowDataBound">
</asp:Gridview>
在c#中
protected void bindedition()
{
SqlConnection con = new SqlConnection(str);
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter();
try
{
con.Open();
da = new SqlDataAdapter("usp_edition_comparison", con);
da.Fill(dt);
gvedition.DataSource = dt;
gvedition.DataBind();
}
catch (Exception ex)
{
ex.Message.ToString();
}
finally
{
con.Close();
}
在 sql 表中
sno feature starter standard
1 master 1 1
2 process menu 1 1
3 master report 0 1
4 audit report 0 1
解决方案
推荐阅读
- swiftui - SwiftUI 一个文本中间的标签视图
- java - setVisibility(View.GONE) 不起作用!为什么?
- javascript - react-color 的颜色选择器无法正常工作
- android - 协程的父子关系,获取特定的孩子并取消?
- tensorflow - 为什么 pytorch 1.5 比 Tensorflow 2.x 慢?
- flutter - 如何选择将图像上传到我的数据库/存储?
- spring-mvc - 从 SBT 部署 Spring MVC
- c++ - LNK2019 未解析的外部符号“int __cdeclexamAvg(void)”
- haskell - Monoid 类型类
- javascript - 如何在 JS/React-Native 中下载完整的 html 页面?