Hi!
I have a dataTable and one of its columns is a image (bitmap) column .
I've been trying to show this images in my GridView by binding it to GridViewImageColumn but I don't get it.
I read that GridViewImageColumn accepts byte[] and string types so I tryed to use this methods to convert the bitmaps and then put the result in other column and try to bind it to the GridViewImageColumn:
The column in my gridView is still empty.....
I've tryed this code:
And this:
I would really appreciate any help....
I have a dataTable and one of its columns is a image (bitmap) column .
I've been trying to show this images in my GridView by binding it to GridViewImageColumn but I don't get it.
I read that GridViewImageColumn accepts byte[] and string types so I tryed to use this methods to convert the bitmaps and then put the result in other column and try to bind it to the GridViewImageColumn:
Public Shared Function BmpToByte(ByVal _bitmap As System.Drawing.Bitmap) As Byte() Dim _ms As New Global.System.IO.MemoryStream() _bitmap.Save(_ms, System.Drawing.Imaging.ImageFormat.Bmp) Dim _bmpArray As Byte() _bmpArray = _ms.ToArray() _ms.Flush() _ms.Dispose() Return _bmpArrayEnd FunctionPublic Function BitmapToString(ByVal bImage As Bitmap) As String Try Dim data As String Dim ms As New Global.System.IO.MemoryStream() bImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp) Dim _bmpArray As Byte() data = Convert.ToBase64String(ms.ToArray()) Return data Catch ex As Exception Return String.Empty End TryEnd FunctionThe column in my gridView is still empty.....
I've tryed this code:
<telerik:GridViewImageColumn DataMemberBinding="{Binding Logo}" Header="Logo"/>And this:
<telerik:GridViewDataColumn DataMemberBinding="{Binding Logo}" Header="Logo"> <telerik:GridViewDataColumn.CellTemplate> <DataTemplate> <Image Height="30" Width="30" Source="{Binding Logo}"></Image> </DataTemplate> </telerik:GridViewDataColumn.CellTemplate></telerik:GridViewDataColumn>I would really appreciate any help....