首页 > 解决方案 > 如何在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

但在浏览器图像中查看

标签: c#sqlasp.net

解决方案


推荐阅读