Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Gridview visible = false problem VB.NET

  • 06-04-2007 09:26AM
    #1
    Registered Users, Registered Users 2 Posts: 8,645 ✭✭✭


    Hi,

    I have a gridview where i have a BoundField where I set the visible to false as they hold data that is not required for the user to see.

    The gridview is populated by a DataSchema (.xsd file)

    I am trying to retrieve the invisible value from the gridview when the user after a user selects a row but all i get back is nothing. If i remove the visible tag everything works fine.
    
    <asp:GridView ID="grvCustDetails" runat="server" AutoGenerateColumns="false" OnSelectedIndexChanged="grvCustDetails_SelectedIndexChanged" AutoGenerateSelectButton="true">
                        <Columns >
                            <asp:BoundField DataField="custid" HeaderText="Customer ID"/>
                            <asp:BoundField DataField="custname" HeaderText="Customer Name"/>
                            <asp:BoundField DataField="custadd" HeaderText="Customer Address" />
                            <asp:BoundField DataField="custcontdet" HeaderText="Customer Contact Details" />
                            <asp:BoundField DataField="custvatcode" HeaderText="Customer VAT Code" />
                            <asp:BoundField DataField="ppsno" HeaderText="Sales Person ID" />
                            <asp:BoundField DataField="cusDelete" HeaderText="Deleted" Visible="false" />                         
                        </Columns>
                    </asp:GridView>
    
    
        Protected Sub grvCustDetails_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles grvCustDetails.SelectedIndexChanged
    
            Dim row As GridViewRow = grvCustDetails.SelectedRow
            Dim strCustDelete As String = row.Cells(7).Text
    
        End Sub
    
    

    Thanks for your help


Comments

  • Moderators, Science, Health & Environment Moderators Posts: 9,220 Mod ✭✭✭✭mewso


    In .net 2 the grid does not render if set to invisible so I think that may be your problem. Try creating a css class to hide it:-

    .invisible
    {
    display: none;
    }

    Then instead of making it invisible set it's classname to "invisible". Should work then.


Advertisement