Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how do I add a checkboxlist to a standard gridview. When I drag it from the tool box and drop it in the grid nothing happens. i believe there is an easier way than doing programaticcaly. How do I do it just with the help of the tool box. or if the only choice is coding then what is the code.
Posted

Hi,
You can use templatefield in gridview
XML
<asp:gridview>
 <columns>
<asp:templatefield>
   <itemtemplate>
       <asp:checkboxlist>
   </itemtemplate>

</columns>
 
Share this answer
 
v3
Copy and paste inside your gridview

XML
<Columns>
          <asp:TemplateField HeaderText="select">
          <ItemTemplate>
              <asp:CheckBox ID="CheckBox1" runat="server" Width="50px" />
          </ItemTemplate>

         <HeaderTemplate>
         <asp:CheckBox ID="chkAll" runat="server" Text="Select"/></td>
         </HeaderTemplate>
          </asp:TemplateField>

          </Columns>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900