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 6001551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:51:01+00:00 2026-05-23T00:51:01+00:00

I am trying to get the entire datagrid row on checkbox selection . but

  • 0

I am trying to get the entire datagrid row on checkbox selection .
but I can get only the value of id which is bound to checkbox but not others. My code is below:

function btnClick() {
    var mytext
    var gridView1Control = document.getElementById('<%= indivPrincipalGrid.ClientID %>');

    $('#<%= btnGetData.ClientID %>').click(function(e) {
       $('input:checkbox[id$=CheckSelect]:checked', gridView1Control).each(function(item, index) {

            var id = $(this).next('input:hidden[id$=hdID]').val();
            var nm = $(this).find('input:hidden[id$=hdID1]').val();
            alert(id);
            alert(nm);
        });
        return false;

    }); 

my grid is as follows :

<div>
    <asp:Label ID="Label1" runat="server" Text="test"Font-Bold = "true"></asp:Label>
    <asp:GridView ID="indivPrincipalGrid" runat="server" 
        AutoGenerateColumns="False">
    <Columns>
   <asp:BoundField  DataField = "Name"/>
   <asp:TemplateField>
    <ItemTemplate>
   <asp:CheckBox ID="CheckSelect" runat="server" /> 
                <asp:HiddenField ID="hdID" runat="server" Value='<%# Eval("ID")%>'/> 
                <asp:HiddenField ID="hdID1" runat="server" Value='<%# Eval("Name")%>'/>        

    </ItemTemplate></asp:TemplateField></Columns></asp:GridView>

    <asp:Button ID="btnGetData" runat="server" Text="Button" OnClientClick = "btnClick()" />

</div>
  • 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-05-23T00:51:02+00:00Added an answer on May 23, 2026 at 12:51 am

    OK..
    I found that the function supposed to populate the hidden cntrl wasn’t working ok and hence i was getting undefined in client script. Fixing it resolved the issue. Thanks all for help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get the entire raw header into a file but everytime
Trying to get the entire file downloaded -- but I assume the script is
I am trying to get max value from a 3-d Mat, but minmaxIdx and
I'm trying to get it so that each sub list can only be ordered
I am trying to get a layout that always takes up the entire screen,
I'm trying get values from a GridView using the following code: foreach (GridViewRow row
Trying to get an ASP application deployed; it worked for a while but then
I'm not awesome enough to write a chat application, and I'm trying to get
I am trying to get the entire page URL as a string in PHP
I'm trying to get the average value of an attribute in a child entity

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.