How to add checkbox to datagrid?
Answers were Sorted based on User's Feedback
Answer / kiran
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" CellPadding="4">
<Columns>
<asp:BoundField DataField="Status"
HeaderText="PO Status" />
<asp:TemplateField HeaderText="Mark as
Complete" >
<HeaderTemplate>
<asp:CheckBox ID=check runat=server
Checked=false />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkComplete"
runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
| Is This Answer Correct ? | 19 Yes | 6 No |
Answer / amit kumar
first add itemtemplate in gridview than add checkbox in side
the itemtemplate
| Is This Answer Correct ? | 8 Yes | 2 No |
Answer / s.munna
<asp:GridView ID="dgvVerReferral" runat="server"
Height="456px" Width="944px">
<Columns>
<asp:TemplateField HeaderText ="click">
<ItemTemplate >
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
| Is This Answer Correct ? | 1 Yes | 5 No |
Answer / swapna
Dim str as string =" "
dim item as datagriditem
dim chk as checkbox
for each item in datagrid1.items
chk=CType(item.findcontrol("ch"),checkbox)
if chk.checked=true then
str=str & "," & item.cells(1).text
end if
next
Response.write(str)
| Is This Answer Correct ? | 8 Yes | 13 No |
What do you create for easier access of data?
Code for Getting Information About A File?
how to track links visited in google using iframes
what is the value that reside in a hidden field when no value is assigned to it?how it can be used in a if statement??
How to use Client-side Script to Focus Controls in ASP.NET?
Code for Presenting Parent/Child Data in a Data Grid Row?
How to get Dynamically Linked Comboboxes Set?
Code for Communicating over Sockets?
how to upload a photo? i need to use it in a matrimonial applicaton...
How to get the row index on checking a Checkbox in a ListView
how the value of label is printed through a button in asp.net web application
What is the code of Password Recovery or Forget your password? Plz tell in c # language.