Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:55:07+00:00 2026-06-17T13:55:07+00:00

Let me get this straight. I manage to create a custom Gridview with a

  • 0

Let me get this straight. I manage to create a custom Gridview with a single checkbox but my problem here is that I want to include multiple dynamic Checkbox.

Here is my code:

<%@ Control Language="C#" AutoEventWireup="true" EnableTheming="true" CodeFile="GridviewControl.ascx.cs" Inherits="UserControl_GridviewControl" %>

<link href="../Template/CSS/Style.css"type="text/css" rel="Stylesheet" />

<div>
  <span id="Span5" style="font-family: Arial; font-size:12px;" ><asp:Label ID="lblCount" runat="server" Text="0" Font-Bold="true"></asp:Label>
                     Record/s</span>
  <span class="maintenance-btns">
     <asp:Button ID="btnNew" runat="server" Text=" New " onclick="btnNew_Click"/>
     <asp:Button ID="btnDel" runat="server" Text=" Delete " onclick="btnDel_Click"/>
  </span>
</div>

<asp:Panel ID="pnlPc" runat="server" CssClass="div-grid" ScrollBars="Auto">  
<asp:GridView ID="gvListing" runat="server" AllowPaging="True" AutoGenerateSelectButton="true"
            OnRowDataBound="gvListing_RowDataBound" skinid="gvListing"
            onselectedindexchanged="gvListing_SelectedIndexChanged"
            onpageindexchanging="gvListing_PageIndexChanging" PageSize="50" >

<FooterStyle CssClass="grid-footer" />

<Columns>
<asp:TemplateField HeaderText="CheckAll">
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" AutoPostBack="true" 
OnCheckedChanged="chkSelectAll_CheckedChanged" CssClass="select-all"/>
</HeaderTemplate>

<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="true" 
OnCheckedChanged="chkSelect_CheckedChanged" CssClass="listing-checkbox"/>
</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>
</asp:Panel>

In this gridview I only have a checkboxes at the first column. I want to put the dynamically generated checkboxes at the last column.

P.S.: How do I retrieve the id with those dynamically create checkboxes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:55:08+00:00Added an answer on June 17, 2026 at 1:55 pm

    You can do like this

      protected void gvData_DataBound(object sender, EventArgs e) 
      {
        foreach (GridViewRow objRow in gvData.Rows)
        {
          TableCell tcCheckCell = new TableCell();
          var checkBox = new CheckBox();
          checkBox.CheckedChanged += checkBox_CheckedChanged;
          tcCheckCell.Controls.Add(checkBox);
          objRow.Cells.AddAt(0, tcCheckCell);
       }
      }
     void checkBox_CheckedChanged(object sender, EventArgs e)
     {
        //do something
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let me get my question straight, using the @OnDelete here will delete this and
Let's get this out of the way first: I know that SessionFactory is immutable
Let's see I want to do this, i want to get the parent of
Ok, let's try to get this straight: my final intent is to provide a
This should be fairly straight forward but is proving not to be. I want
Before I ask my question, let me get this straight... This is not a
I love LaTeX. Let's get that straight right off the bat. The only thing
I can get this to work: [<DllImport(user32.dll)>] extern bool GetClientRect(nativeint, RECT*) let getClientRect hwnd
Before I get anywhere with this post, let me make this clear, there is
Before you all get pissy about me posting this question again, let me explain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.