|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Hi
I am using a datagrid to show some info from a sqlserver db. One of the fields is a url. I have an image in my datagrid that has an anchor tag that uses the url from the db. This works fine. However i would like for the image to disappear if the value is null. Is this possible? What's the easiest way to do this? The image is displayed within an item template along with other fields that have to be shown regardless of the contents of the url field. Thanks for any help and i hope this wasnt too confusing waffle to understand! J. |
|
#2
|
|||
|
|||
|
Code:
Dim myImage as New WebControls.Hyperlink()
If dtDataGrid.Rows(i)("image") = System.DBNull.Value Then
MyImage.ImageUrl = String.Empty
MyImage.Visible = False
Else
MyImage.ImageUrl = dtDataGrid.Rows(i)("image")
MyImage.Visible = True
End If
Hope this helps,
__________________
- Rogier Doekes |
![]() |
| Viewing: Dev Articles Community Forums > Programming > .NET Development > Null values in Datagrids |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|