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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
This video discusses moving either the default database or any database to a new volume.

747 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

16 Experts available now in Live!

Get 1:1 Help Now