NoviceToDotNet
NoviceToDotNet

Reputation: 10805

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?

Upvotes: 2

Views: 1636

Answers (3)

challengeAccepted
challengeAccepted

Reputation: 7590

<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!

Upvotes: 1

Dave McClelland
Dave McClelland

Reputation: 3413

Right click the grid view and add a template column. Inside that column, you are able to put whatever you want - including a checkbox.

Upvotes: 0

user1921
user1921

Reputation:

You could use a < asp:TemplateColumn > or, depending on your desired functionality, opt for a repeater control instead.

Upvotes: 0

Related Questions