Hi everyone,
I am reading and displaying data rows from my database where the first
column contains the Status checkbox. I like to enable my users to change
the status of individual rows by checking and unchecking the checkbox
column. I like to update the status in the database for the column where
the status was changed.
This is what I'm doing so far
<asp:datagrid id="MyDataGrid " runat="server" CellPadding="2"
AutoGenerateCol umns="false" HeaderStyle-CssClass="maint ableheader"
Width="95%">
<Columns>
<asp:BoundColum n DataField="BID" ReadOnly="True"
Visible="False" ></asp:BoundColumn >
<asp:TemplateCo lumn HeaderText="Act ive" Visible="True"
ItemStyle-HorizontalAlign ="Center">
<ItemTemplate >
<asp:CheckBox ID="Status" Runat="server" Checked='<%#
FormatStatus(Da taBinder.Eval(C ontainer.DataIt em, "Status")) %>'
AutoPostBack=Tr ue OnCheckedChange d="UpdateCheckb oxStatus">
</asp:CheckBox>
</ItemTemplate>
</asp:TemplateCol umn>
....etc.
and in my .cs page
public void UpdateCheckboxS tatus(object sender, System.EventArg s e)
{
Response.Write ("You click the row...")...
}
How can I find out which row was clicked? Please let me know if there is a
better way to do this.
Thank you
Maz