Adding check box to grid view for each row
I am filling a GridView
with the data table but on each 开发者_运维问答row I want a check box how can I achieve this?
<Columns>
<asp:TemplateField HeaderText="Select" HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Checked="false" />
</ItemTemplate>
</asp:TemplateField>
Use this, you will find what you want!
You could use a < asp:TemplateColumn > or, depending on your desired functionality, opt for a repeater control instead.
Right click the grid view and add a template column. Inside that column, you are able to put whatever you want - including a checkbox.
精彩评论