Hey all,
I'd like to have a field displayed as a hyperlink in one of my columns, but only if one of the other fields = 51. Here is what I've got.
Private Sub dgMGLUNSfill()
Dim strSQL As String
strSQL = "select GJID, GJDESC, GJAMT " & _
"from MSTLIB.MGLUNS " & _
"where GJACCT = '" & cmbAccounts.SelectedItem.Value & "' "
Dim dr As OleDbDataReader
dr = GetDataReader(strSQL)
dgMGLUNS.DataSource = dr
'set up columns for grid
dgMGLUNS.AutoGenerateColumns = False
Dim urlCol As HyperLinkColumn = New HyperLinkColumn()
urlCol.DataTextField = "GJID"
urlCol.DataNavigateUrlField = "GJID"
urlCol.HeaderText = "I.D."
Dim ammtCol As BoundColumn = New BoundColumn()
ammtCol.DataField = "GJAMT"
ammtCol.HeaderText = "Ammount"
ammtCol.DataFormatString = "{0:c}"
Dim descCol As BoundColumn = New BoundColumn()
descCol.DataField = "GJDESC"
descCol.HeaderText = "Description"
dgMGLUNS.Columns.Add(urlCol)
dgMGLUNS.Columns.Add(ammtCol)
dgMGLUNS.Columns.Add(descCol)
'---------end column setup----------
dgMGLUNS.DataBind()
End Sub
Basically what I would like is to have the field only be a hyperlink if GJID = 51
Any Suggestions?
I'd like to have a field displayed as a hyperlink in one of my columns, but only if one of the other fields = 51. Here is what I've got.
Private Sub dgMGLUNSfill()
Dim strSQL As String
strSQL = "select GJID, GJDESC, GJAMT " & _
"from MSTLIB.MGLUNS " & _
"where GJACCT = '" & cmbAccounts.SelectedItem.Value & "' "
Dim dr As OleDbDataReader
dr = GetDataReader(strSQL)
dgMGLUNS.DataSource = dr
'set up columns for grid
dgMGLUNS.AutoGenerateColumns = False
Dim urlCol As HyperLinkColumn = New HyperLinkColumn()
urlCol.DataTextField = "GJID"
urlCol.DataNavigateUrlField = "GJID"
urlCol.HeaderText = "I.D."
Dim ammtCol As BoundColumn = New BoundColumn()
ammtCol.DataField = "GJAMT"
ammtCol.HeaderText = "Ammount"
ammtCol.DataFormatString = "{0:c}"
Dim descCol As BoundColumn = New BoundColumn()
descCol.DataField = "GJDESC"
descCol.HeaderText = "Description"
dgMGLUNS.Columns.Add(urlCol)
dgMGLUNS.Columns.Add(ammtCol)
dgMGLUNS.Columns.Add(descCol)
'---------end column setup----------
dgMGLUNS.DataBind()
End Sub
Basically what I would like is to have the field only be a hyperlink if GJID = 51
Any Suggestions?