|
-
Mar 27th, 2024, 04:33 AM
#1
Thread Starter
Addicted Member
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.

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?
Last edited by cliv; Mar 27th, 2024 at 04:36 AM.
-
Mar 27th, 2024, 04:49 AM
#2
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
-
Mar 27th, 2024, 05:15 AM
#3
Thread Starter
Addicted Member
Re: VSFlexGrid only picture in column and not text.
 Originally Posted by Arnoutdv
And what if you set .TextMatrix to ""
Doesn't work ... maybe because grid is bound.
-
Mar 27th, 2024, 05:58 AM
#4
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?
-
Mar 27th, 2024, 05:58 AM
#5
Addicted Member
Re: VSFlexGrid only picture in column and not text.
 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.
-
Mar 27th, 2024, 06:06 AM
#6
Thread Starter
Addicted Member
Re: VSFlexGrid only picture in column and not text.
 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...
 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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|