Getting the selected index value in Navigateurl property

  • 12 years ago

    Hi

     I have set the hyperlinkcolumn for the value retrieved from datatable  using the following code......

    but i need to get the value for usercode using selectedrow property..means i will get the value for usercode only after clicking the hyperlink.........but in the row databound it is not possible to get the selected row value.....pls help me to solve this issue 

    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound

    Dim myctrl = e.Row.FindControl("Transaction Count")

    For i = 1 To ct - 1 Step 2

    If e.Row.Cells(i).Text <> "0" Then

    Dim hlControl As New HyperLink()

    hlControl.Text = e.Row.Cells(i).Text

    hlControl.NavigateUrl =
    "iscNScanUserDetail.aspx?usercode=" + uc + "&trxndt=" + trxndt + "&trtype=" + trtype + "&amc=" + amc

    e.Row.Cells(i).Controls.Add(hlControl)

    End If

    Next

    End Sub

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan