Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Gridview visible = false problem VB.NET

Options
  • 06-04-2007 9:26am
    #1
    Registered Users Posts: 7,677 ✭✭✭


    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: 8,950 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