<asp:gridview>
<columns>
<asp:templatefield headertext="Select">
<itemtemplate>
<asp:checkbox id="cbSelect" runat="server">
<asp:label id="uniqueId" runat="server"
text='<%# Eval("uniqueid") %>'
CssClass="hidden" />
</asp:label>
</asp:checkbox>
...
</itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>
You can then loop through the rows in the GridView and see which ones have been selected, picking out the unique ids for those.
The CSS for hidden is simply:
.hidden {
display: none;
}
Which hides the item, but still renders it in html so that you can retrieve it (unlike Visible=false which does not render it in html at all).
Ingen kommentarer:
Legg inn en kommentar