click anywhere in gridview to send a row as a session textbox using VB

Posted on 2009-02-24
Last Modified: 2012-05-06
i need to be able to click on any row in a gridview and then send one item from a database to populate a listview on another page.  Example: show two fields of a 10 field table and then by clicking on one row you can pull up the detail for the entire row of data.

i've had great help but it was using C## and i can't quite get it to convert correctly using VB.
Question by:erockman9
    LVL 52

    Accepted Solution

    Can you post what you have in C# and the VB you converted to and we can check it is correct in the first instance.

    Author Comment

    this is what i'm using.  what i really want is that once the onclick is done i it to stay highlighted until i click the button to take me to the next page.  right now it works but the color keeps going even though the onclick does create the session.

    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
            e.Row.RowType = DataControlRowType.DataRow
            e.Row.Attributes.Add("onmouseover", "'FFFF99'")
            e.Row.Attributes.Add("onmouseout", "'FFFFFF'")
            e.Row.Attributes.Add("onclick", Page.ClientScript.GetPostBackClientHyperlink(sender, "Select$" + e.Row.RowIndex.ToString))
     Protected Sub LinkButton3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles LinkButton3.Click
            Session("CarrierID") = GridView1.SelectedValue
        End Sub

    Open in new window


    Author Comment

    got it...thanks

    Author Closing Comment

    got it thanks,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now