1 Attachment(s)
VSFlexGrid only picture in column and not text.
I maintain an old application who use vsFlexGrid. Grid is bound to a database and one field display 0 and 1 values. I try to replace this value with picture, so in AfterDataRefresh event i have this code:
Code:
With grid
.Redraw = flexRDNone
For f = 1 To .Rows - 1
If .ValueMatrix(f, 2) = 0 Then
.Cell(flexcpPicture, f, 2, f, 2) = imgHandleNOK
Else
.Cell(flexcpPicture, f, 2, f, 2) = imgHandleOK
End If
.Cell(flexcpPictureAlignment, f, 2, f, 2) = flexAlignCenterCenter
Next f
.Redraw = flexRDDirect
End With
... but grid display image and textvalue from database.
Attachment 190923
I can't use
Code:
.ColImageList(2) = imgList.hImageList 'handle to an ImageList
because image are stored in a ImageManager control from Codejock Activex and the control doesn't deliver the handle. I obtain one by one image using this code:
Code:
Dim imgHandleOK As StdPicture, imgHandleNOK As StdPicture
Set imgHandleOK = ImageManager.Icons.GetImage(1, 16).CreatePicture(xtpImageNormal)
Set imgHandleNOK = ImageManager.Icons.GetImage(2, 16).CreatePicture(xtpImageNormal)
...so can i display only image in column?
Re: VSFlexGrid only picture in column and not text.
And what if you set .TextMatrix to ""
Code:
With grid
.Redraw = flexRDNone
For f = 1 To .Rows - 1
If .ValueMatrix(f, 2) = 0 Then
.Cell(flexcpPicture, f, 2, f, 2) = imgHandleNOK
Else
.Cell(flexcpPicture, f, 2, f, 2) = imgHandleOK
End If
.Cell(flexcpPictureAlignment, f, 2, f, 2) = flexAlignCenterCenter
.TextMatrix(f, 2) = ""
Next f
.Redraw = flexRDDirect
End With
Re: VSFlexGrid only picture in column and not text.
Quote:
Originally Posted by
Arnoutdv
And what if you set .TextMatrix to ""
Doesn't work ... maybe because grid is bound.
Re: VSFlexGrid only picture in column and not text.
Is there a specific reason for having the grid bound to a dataset?
In other words can it be disconnected?
Re: VSFlexGrid only picture in column and not text.
Quote:
Originally Posted by
cliv
I maintain an old application who use vsFlexGrid. Grid is bound to a database and one field display 0 and 1 values. I try to replace this value with picture, so in AfterDataRefresh event i have this code:
...so can i display only image in column?
-----------------------------------------------
Hi
The best case is to hide the field from which you get the information and assign the image to a new field.
Re: VSFlexGrid only picture in column and not text.
Quote:
Originally Posted by
Arnoutdv
Is there a specific reason for having the grid bound to a dataset?
In other words can it be disconnected?
as i say it's and old application written more than 20 years ago with a lot of grid bound so change all involves a lot...
Quote:
Originally Posted by
Mojtaba
The best case is to hide the field from which you get the information and assign the image to a new field.
...yes it is a solution