GridViewImageColumn

Sample code relating to the GridViewImageColumn

Step on would be to create a table in SQL with an image field

 

INSERT INTO fpimage(ImageBlob,ImageName, Height, Width)
SELECT BulkColumn , 'Pixel',1,1
    FROM Openrowset( Bulk 'G:\projects\NGB\Common Images\Pixel.png', Single_Blob) as EmployeePicture

Step two would be to include that field in your grid query, and display it like this

Function createGridViewImageColumn(ByVal strHeaderText As String, ByVal strFieldName As String,
                                    ByVal intWidth As Int16, bVisible As Boolean) As GridViewImageColumn
    Dim ImageColumn As New GridViewImageColumn()
    ImageColumn.IsVisible = bVisible
    ImageColumn.Name = strFieldName
    ImageColumn.HeaderText = strHeaderText
    ImageColumn.FieldName = strFieldName
    ImageColumn.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter
    ImageColumn.Width = intWidth
    Return (ImageColumn)
End Function


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences