Missing link in HyperLink Column in datagrid

G

Guest

I have a HyperLink Column , View, in DataGrid, which link to URL Field,
called URLQuery.

In codebehind, I have
dsResource.Tables("Resource4Spec").Columns.Add("URLQuery",
Type.GetType("System.String"), "MethodName + '?pkey=' + PatientKey + '&prot='
+ Protocol + '&ip=' + IPaddress + '&path=' + DirPath + '&file=' + FileName +
'&rscID=' + ResourceID")

where MethodName, PatientKey, IPaddress, DirPath, FileName, and ResourceID
are column names of a database table.

The problem is that when FileName field in a row is NULL (Nothing), the View
field is not highlighted (i.e., not enabled) and URLQuery field is empty too
in that row.

In this case, how can I do such that the URLQuery field can have other
key/name pairs but not file/FileName?

Thank you

David
 
G

Guest

Replace the null field by a blank like this: IsNull(FileName,'')
dsResource.Tables("Resource4Spec").Columns.Add("URLQuery",
Type.GetType("System.String"), "MethodName + '?pkey=' + PatientKey +
'&prot='
+ Protocol + '&ip=' + IPaddress + '&path=' + DirPath + '&file=' +
IsNull(FileName,'') +
'&rscID=' + ResourceID")
 
G

Guest

Thank you

Phillip Williams said:
Replace the null field by a blank like this: IsNull(FileName,'')
dsResource.Tables("Resource4Spec").Columns.Add("URLQuery",
Type.GetType("System.String"), "MethodName + '?pkey=' + PatientKey +
'&prot='
+ Protocol + '&ip=' + IPaddress + '&path=' + DirPath + '&file=' +
IsNull(FileName,'') +
'&rscID=' + ResourceID")

--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top