<pre lang="HTML"> <div> <asp:GridView ID="gdvReceivedLetter" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="3" DataKeyNames="ID" GridLines="Horizontal" EmptyDataText="No Records Found" PageSize="10" Width="95%" BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" Font-Names="Arial" Font-Size="10.5" BorderWidth="1px" OnSelectedIndexChanged="gdvReceivedLetter_SelectedIndexChanged" OnPageIndexChanging="gdvReceivedLetter_PageIndexChanging"> <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" /> <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" /> <Columns> <asp:BoundField DataField="ID" HeaderText="ID" Visible="False"></asp:BoundField> <asp:TemplateField Visible="true"> <HeaderTemplate> <input type="CheckBox" id="chkSelect" runat="server" /> </HeaderTemplate> <ItemTemplate> <asp:CheckBox runat="server" ID="chkDelete" /> </ItemTemplate> <HeaderStyle Width="9px" /> <ItemStyle Width="9px" /> </asp:TemplateField> <asp:BoundField DataField="FileName" HeaderText="File Name"> <HeaderStyle CssClass="GridItemHeaderLarge" /> <ItemStyle CssClass="GridItemLarge" /> </asp:BoundField> </Columns> <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" /> <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" /> <HeaderStyle BackColor="#4A3C8C" ForeColor="#F7F7F7" /> <AlternatingRowStyle BackColor="#F7F7F7" /> </asp:GridView> </div> <table width="100%"> <tr> <td width="80%"> </td> <td width="20%" style="padding-removed 18px"> <asp:Button runat="server" ID="btnDelete" Text="Delete" Font-Bold="true" OnClientClick="return Delete();" Enabled="true" OnClick="btnDelete_Click" /> </td> </tr> </table>
<pre lang="c#"> foreach (GridViewRow chkrow in gdvReceivedLetter.Rows) { CheckBox chk = (CheckBox)chkrow.FindControl("chkDelete"); if (chk != null && chk.Checked) { Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('CHECKEDDDDD');", true); //////here is the PROBLEM ////exen the check box is checked the cursor never comes here!!! WHY!!???? } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)