• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1622
  • Last Modified:

DevExpress Gridview - Hyperlink colum

I am bindind Devexpress Gridview from code behind. I want to turn one column named 'tracking_number" into hyperlink. When a user click it, I want it to redirect to a page with tracking.  This is what I have so far.

Imports System.Data.SqlClient
Imports System.Data
Imports System.Web.Configuration
Imports DevExpress.Web.ASPxGridView


Public Class sp_amp_sales_Main_Demo
    Inherits System.Web.UI.Page

    Private Sub Test_01_Init(sender As Object, e As System.EventArgs) Handles Me.Init
        ASPxGridView1.DataSource = Session("grid1")
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Session.Remove("grid1")
        If Page.IsPostBack = True Then
            Session("grid1") = ASPxGridView1.DataSource
            ASPxGridView1.DataBind()

        End If
    End Sub

    Public Sub BindGrid()

        Try
            Session("grid1") = getData(ASPxTextBox_userid.Text.Trim)
            ASPxGridView1.DataSource = Session("grid1")
            ASPxGridView1.DataBind()

            ApplyLayout(0)

        Catch ex As Exception

        End Try

    End Sub

    Public Function getData(ByVal userid As String) As DataSet

        Dim sqlCon As New SqlConnection(ConfigurationManager.ConnectionStrings("myconn").ConnectionString)
        Dim ds As New DataSet
        Dim sqlComm As New SqlCommand("sp_sample01", sqlCon)
        sqlComm.CommandType = CommandType.StoredProcedure
        sqlComm.Parameters.AddWithValue("@UserID", userid)
        Dim sqlApt As New SqlDataAdapter(sqlComm)
        sqlCon.Open()
        sqlApt.Fill(ds)
        Return ds

    End Function


    Private Sub ApplyLayout(ByVal layoutIndex As Integer)

        ASPxGridView1.BeginUpdate()
        Try
            ASPxGridView1.ClearSort()
            Select Case layoutIndex
                Case 0
                    ASPxGridView1.GroupBy(ASPxGridView1.Columns(0))
                    'Case 7
                    '    ASPxGridView1.GroupBy(ASPxGridView1.Columns(7))
            End Select
        Finally
            ASPxGridView1.EndUpdate()
        End Try
        ASPxGridView1.ExpandAll()
    End Sub

    Private Sub ASPxButton1_Click(sender As Object, e As System.EventArgs) Handles ASPxButton1.Click
        Call BindGrid()
    End Sub

Open in new window

Grid.gif
0
VBdotnet2005
Asked:
VBdotnet2005
1 Solution
 
VBdotnet2005Author Commented:
Any thoughts Experts?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now