Solved

Get Value of gridview field that is set to visible false

Posted on 2010-08-27
4
543 Views
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
0
Comment
Question by:techpr0
  • 2
4 Comments
 

Author Comment

by:techpr0
ID: 33543552
using vb.net
0
 
LVL 17

Expert Comment

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

Accepted Solution

by:
Anil Golamari earned 250 total points
ID: 33543656
0
 

Author Comment

by:techpr0
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" />
          <Columns>
              <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>
             <asp:BoundField DataField="Serial Number" HeaderText="Serial Number" 
                SortExpression="Serial Number" >
              <HeaderStyle Font-Size="Small" HorizontalAlign="Center" />                
              <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="Name" HeaderText="Customer Name" SortExpression="Name">
              <HeaderStyle Font-Size="Small" HorizontalAlign="Center" />                
              <ItemStyle HorizontalAlign="Center" Width="170px" />
            </asp:BoundField>

Open in new window

0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 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