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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:25:08+00:00 2026-06-04T06:25:08+00:00

I have in my gridview the following two BoundFields <asp:BoundField DataField=ProductId HeaderText=ID HeaderStyle-HorizontalAlign=Left Visible

  • 0

I have in my gridview the following two BoundFields

<asp:BoundField DataField="ProductId" HeaderText="ID" HeaderStyle-HorizontalAlign="Left" Visible = "false" />
 <asp:BoundField DataField="ProductDescription" HeaderText="product Description" HeaderStyle-HorizontalAlign="Left" />

How can I obtain the value of the first bound field if its set to visible false?

  • 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-04T06:25:09+00:00Added an answer on June 4, 2026 at 6:25 am

    You can’t access the value of BoundField that is invisible. You have to use TemplateField and add the HiddenField control in it and bind its Value property.

    Markup,

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HiddenField ID="HiddenField1" runat="server" 
                        Value='<%# Eval("ProductId") %>' />
                     ....
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    

    Code behind to get the value from HiddenField control of 1st cell of each row.

     foreach (GridViewRow row in GridView1.Rows)
      {
        if (row.RowType == DataControlRowType.DataRow)
          {
           HiddenField productid = row.Cells[0].FindControl("HiddenField1") as HiddenField;
           ...
           }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview with the following markup: <asp:GridView ID=gv runat=server Width=700px skinid=gridview HeaderStyle-HorizontalAlign=Left
I have this gridview: <div class=content> <asp:GridView ID=DocumentGrid runat=server AutoGenerateColumns=False OnRowCommand=DocumentGrid_RowCommand > <Columns> <asp:BoundField
I have following Gridview: <asp:GridView ID=GridView1 runat=server CssClass=table DataKeyNames=groupId DataSource=<%# dsUserGroupsSelected %> DataMember=Group etc....>
I have a simple gridview <asp:GridView ID=GridView1 runat=server DataKeyNames=OriginatorID AutoGenerateColumns=False AllowPaging=True OnPageIndexChanging=GridView1_PageIndexChanging PageSize=5 OnPreRender=GridView1_PreRender>
I have a asp:GridView and in there i have two columns , in one
I have created two buttons in a gridview. I wish to achieve the following
I have the following scenario. I have two methods of populating a GridView with
I have the following two controls in my code gridview (for data display) sqldatasource
On an ASP NET project I have a gridview control with the following information:
I have a GridView control in an asp.net 3.5 webpage, the following code executes

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.