Home All Groups Group Topic Archive Search About

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

Author
20 Sep 2007 7:36 PM
Brian
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?

Author
22 Sep 2007 6:40 PM
Jay Pondy
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 <Br***@discussions.microsoft.com>
wrote:

Show quote
>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?

AddThis Social Bookmark Button