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 |
i have a gird with columns all are coming from database,this will bind in item templete in gridview as textboxex.and i have button below named Update.i want to update all the records in the grid,but if user change the value of one textbox,what is the easy way 2 do this
where is assembly are store
how to upload an excel in c# ASP.Net?
Code for Communicating over Sockets?
ArrayList declaration in .net
what is software testing
How to Export Data to Excel?
How to get the row index on checking a Checkbox in a ListView
How to add checkbox to datagrid?
How to get Dynamically Linked Comboboxes Set?
Listview design in .net
Common UI for Multiple web applications. Suppose there are 35 websites using same third party controls.These 3rd party controls are made together that all 35 websites can use these controls.If we put all 3rd party controls and use its dll in 35 websites,only class files will be accessable. But I want to use CSS,images also in all 35 websites. how I can design the N-tier solution for this project.