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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:48:42+00:00 2026-05-24T17:48:42+00:00

I cannot seem to get the value of a cell in a gridview to

  • 0

I cannot seem to get the value of a cell in a gridview to use in a stored procedure. Here is my aspx:

<asp:GridView ID="gvData" runat="server" AutoGenerateColumns="false" SkinID="GridView" DataKeyNames="Check Config">
            <Columns>
                <asp:BoundField HeaderText="Config ID" DataField="Check Config"></asp:BoundField>
                <asp:BoundField HeaderText="Check Configuration" DataField="Check Configuration" />
                <asp:BoundField HeaderText="Shift" DataField="Shift" />
                <asp:BoundField HeaderText="Earliest Time" DataField="Earliest Time" />
                <asp:BoundField HeaderText="Alarm Time" DataField="Alarm Date" />
                <asp:BoundField HeaderText="Disposition" DataField="Disposition" />
                <asp:TemplateField HeaderText="Disable">
                    <ItemTemplate>
                        <asp:CheckBox runat="server" ID="RowLevelCheckBox" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

And here is my code-behind wherein I’m trying to get the value of the first column/cell in the gridview for a stored procedure parameter. In this case I am looking to get the value of “Config ID” but get 0 back each time. It’s been a while since I’ve been back into ASP.NET but this project calls for it.

try
        {
            foreach (GridViewRow dr in gvData.Rows)
            {
                CheckBox chk = (CheckBox)dr.Cells[6].FindControl("RowLevelCheckBox");
                if (chk.Checked)
                {
                    recordCount += 1;
                    int theConfigID = Convert.ToInt32(dr.Cells[0].FindControl("Config ID").ToString());
                    //cancel these alarms in DB 
                    command.Parameters.Add(new SqlParameter("@CHECK_SCHEDULE_ID", theConfigID));
                    command.ExecuteNonQuery();

                    //return status and msg
                    lblStatusMessage.ForeColor = System.Drawing.Color.DarkGreen;
                    lblStatusMessage.Text = string.Format("{0} alarm(s) were successfully cancelled.", recordCount);
                    lblStatusMessage.Visible = true;
                }
            }
        }
  • 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-24T17:48:43+00:00Added an answer on May 24, 2026 at 5:48 pm

    how about just dr.Cells[0].Text?

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

Sidebar

Related Questions

I cannot seem to get the value from a select option that has been
I have this design which I cannot seem to get right, I would like
I need a function, but cannot seem to get it quite right, I have
I'm terribly new to SQL, and cannot seem to get the desired information out,
This is a very old problem, but I cannot seem to get my head
So obviously I am doing something wrong, but I just cannot seem to get
How can I get jaxb to bind to my Vector? I cannot seem to
I cannot seem to get CI's session library to function the way I want
In the same below, I cannot seem to get a bold around the $(Product)
I am reading here: http://groovy.codehaus.org/modules/http-builder/doc/get.html I seem to be able to get i) XMLSlurper

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.