g_r_a_robinson Posted January 15, 2004 Posted January 15, 2004 I have a datalist with a checkbox in each of the rows like so. <ItemTemplate> <TABLE> <TR bgColor="#330099" style="BACKGROUND-IMAGE: url(..\..\..\WebFiles\images\barForNotes.gif)" id="RowHeaderBar" runat="server"> <TD style="FONT-WEIGHT: bold; COLOR: white"> <%# DataBinder.Eval(Container.DataItem, NotesData.BYWHO_FIELD) %> did a <%# DataBinder.Eval(Container.DataItem, NotesData.FK_ACTION_PERFORMED_FIELD) %> on <%# DataBinder.Eval(Container.DataItem, NotesData.JOB_DATE_FIELD) %> . This entry was added on <%# DataBinder.Eval(Container.DataItem, NotesData.DATE_FIELD) %> </TD> </TR> <TR> <TD><%# DataBinder.Eval(Container.DataItem, NotesData.NOTE_DESCRIPTION_FIELD) %></TD> </TR> <tr> <td align="right"> Read <asp:CheckBox ID="Notes_CBX" Runat="server" AutoPostBack="True" Checked=""></asp:CheckBox> </td> </tr> </TABLE> </ItemTemplate> I just dont know how to reference which one was checked. Anyone can help!! Quote
Moderators Robby Posted January 15, 2004 Moderators Posted January 15, 2004 Do you want Notes_CBX to get its' values from the datatable ? Quote Visit...Bassic Software
Bodybag Posted January 16, 2004 Posted January 16, 2004 <asp:CheckBox id=chkpresent runat="server" Width="10px" Checked='<%# DataBinder.Eval(Container, "DataItem.SchedulerAtwork") %>'></asp:CheckBox> Private Sub saveall(ByVal dt As DataList, ByRef tbl As DataTable) For irowcount As Integer = 0 To dt.Items.Count - 1 tbl.Rows.Find(CType(dt.Items(irowcount).FindControl("lblpk"), Label).Text).Item("scheduleratwork") = CType(dt.Items(irowcount).FindControl("chkpresent"), CheckBox).Checked Next Me.adapscheduler.Update(tbl) End Sub Hope this what you wanted to do. Quote Programmers are trying to create bigger and beter idiot proof programs.The universe is trying to create bigger and beter idiots and so far the universe is winning.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.