If you are directly binding datasource to a gridview defining bound columns then checkbox will be displayed for
Bit
fields.
If you want the checkbox to be clickable, then you need to define
Template Column
or
CheckBoxField
for BIT column.
See example in below link for CheckBoxField:
aspnet-gridview-checkboxfield-example[
^]
For Template Column, refer following code:
<asp:gridview id="GridView1" runat="server" allowpaging="True" xmlns:asp="#unknown">
AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="PersonID"
DataSourceID="mySource" Width="366px" CellPadding="4"
ForeColor="#333333" GridLines="None">
<columns>
<asp:commandfield showselectbutton="True" />
<asp:boundfield datafield="PersonID" headertext="PersonID">
InsertVisible="False" ReadOnly="True" SortExpression="PersonID" />
<asp:boundfield datafield="Name" headertext="Name">
SortExpression="Name" />
<asp:templatefield headertext="Select">
<itemtemplate>
<asp:checkbox id="chkSelect" runat="server" />
</itemtemplate>
<headertemplate>
</headertemplate>
</asp:templatefield>
</asp:boundfield></asp:boundfield></columns>
<footerstyle backcolor="#990000" font-bold="True" forecolor="White" />
<rowstyle backcolor="#FFFBD6" forecolor="#333333" />
<pagerstyle backcolor="#FFCC66" forecolor="#333333">
HorizontalAlign="Center" />
<selectedrowstyle backcolor="#FFCC66" font-bold="True" forecolor="Navy" />
<headerstyle backcolor="#990000" font-bold="True" forecolor="White" />
<alternatingrowstyle backcolor="White" />
</pagerstyle></asp:gridview>
Also refer this link:
Selecting multiple checkboxes inside a GridView control[
^]