Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2009-02-24
Medium Priority
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
  • 3
LVL 52

Accepted Solution

Carl Tawn earned 1500 total points
ID: 23745530
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

ID: 23759762
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", "this.style.backgroundColor='FFFF99'")
        e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='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

ID: 23968363
got it...thanks

Author Closing Comment

ID: 31550669
got it thanks,

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

581 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