Get Value of gridview field that is set to visible false

Posted on 2010-08-27
Last Modified: 2012-06-27
I have a Primary key that is invisible in the gridview. When the row is selected in the gridview i would like to get the value of this field.

I tried datakeynames with no luck so far
Question by:techpr0
  • 2

Author Comment

ID: 33543552
LVL 17

Expert Comment

ID: 33543647
some code?
invisible key....? datasource ....?
LVL 18

Accepted Solution

Anil Golamari earned 250 total points
ID: 33543656

Author Comment

ID: 33543667
this is the first few lines of the gridview
             <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource2" 

                    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 

                    BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 

                    CellPadding="4" ForeColor="Black" GridLines="Vertical" 

        Width="720px" PageSize="25" DataKeyNames="CertID">

          <RowStyle BackColor="#F7F7DE" />


              <asp:CommandField ShowSelectButton="True" ButtonType="Image" 

                  SelectImageUrl="images/clean.png" />

             <asp:BoundField DataField="CertID" HeaderText="CertID" 

                InsertVisible="False" ReadOnly="True" SortExpression="CertID" Visible=false />

             <asp:BoundField DataField="Invoice Authorization" HeaderText="Invoice Authorization" 

                SortExpression="Invoice Authorization" >

              <HeaderStyle Font-Size="Small" />                

              <ItemStyle HorizontalAlign="Center" Width="30px" />


             <asp:BoundField DataField="Serial Number" HeaderText="Serial Number" 

                SortExpression="Serial Number" >

              <HeaderStyle Font-Size="Small" HorizontalAlign="Center" />                

              <ItemStyle HorizontalAlign="Center" />


            <asp:BoundField DataField="Name" HeaderText="Customer Name" SortExpression="Name">

              <HeaderStyle Font-Size="Small" HorizontalAlign="Center" />                

              <ItemStyle HorizontalAlign="Center" Width="170px" />


Open in new window


Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flash ( has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now