check only one checkbox in gridview using jquery

Posted by Gurbax Singh Bhangal on Stack Overflow See other posts from Stack Overflow or by Gurbax Singh Bhangal
Published on 2011-11-19T09:45:23Z Indexed on 2011/11/19 9:50 UTC
Read the original article Hit count: 315

Filed under:
|
|

i have a grid view in which i have placed the checkbox in itemtemplate

i want only the one checkbox is selected from Gridview to select that perticular row so that i can use that id to edit or delete the row

aspx page code is

            <asp:TemplateField Visible="false">
                <ItemTemplate>
                    <asp:Label ID="lblId" runat="server" Text='<%#Eval("id") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Select
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:CheckBox ID="chkSelect" runat="server"/>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Branch Name
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblBranch_Name" runat="server" Text='<%# Bind("Branch") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    Address
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblAddress" runat="server" Text='<%# Eval("Address") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <HeaderTemplate>
                    City
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblCity" runat="server" Text='<%# Bind("City") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

        </Columns>

and i want when i click on the checkbox which is at first of each row only one check box is selected from all the rows

thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about jQuery