how to get the text value of a cell in a column that is not visibl

Discussion in 'ASP .Net Web Controls' started by Brian, Sep 20, 2007.

  1. Brian

    Brian Guest

    I have a grid control with an invisible column. I use something like this
    usually:
    string s = gvDNR.SelectedRow.Cells[1].Text;
    however when the column is not visible the text is always empty. Where is it
    kept?
    Brian, Sep 20, 2007
    #1
    1. Advertising

  2. Brian

    Jay Pondy Guest

    If I remember correctly you have to use a template field:

    <asp:TemplateField Visible="false">
    <ItemTemplate>
    <asp:Label ID="lblPKID" runat="server" Text='<%# Eval("PKID") %>' />
    </ItemTemplate>
    </asp:TemplateField>

    On Thu, 20 Sep 2007 12:36:04 -0700, Brian <>
    wrote:

    >I have a grid control with an invisible column. I use something like this
    >usually:
    >string s = gvDNR.SelectedRow.Cells[1].Text;
    >however when the column is not visible the text is always empty. Where is it
    >kept?
    Jay Pondy, Sep 22, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGF1bA==?=

    datagrid-how to get cell value(hyperlink column)

    =?Utf-8?B?UGF1bA==?=, Oct 12, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    8,861
    =?Utf-8?B?UGF1bA==?=
    Oct 13, 2004
  2. Replies:
    2
    Views:
    1,313
  3. Greg Smith
    Replies:
    0
    Views:
    529
    Greg Smith
    Apr 12, 2007
  4. Greg Smith
    Replies:
    0
    Views:
    151
    Greg Smith
    Apr 12, 2007
  5. Rahul
    Replies:
    6
    Views:
    141
    Rahul
    Mar 12, 2007
Loading...

Share This Page