PDA

Click to See Complete Forum and Search --> : Unbound Grid Question


Rev. Michael L. Burns
Jun 26th, 2000, 12:10 AM
I am updating a database to VB6 that was originally written in VB4. It uses an unbound grid (Grid32.OCX which is a special OLE Type control) in many places throughout. I had VB set so that in upgraded all controls and so everything seems to be ok and it runs identically in VB6 as it did in VB4. However, checking information shows that this grid control is still version 1.0. I can't believe that it has never been updated but a check on the VB6 CD under Controls\Tools reveals that this is apparently the case, as the copy of Grid32.ocx there is also veersion 1.0. I can't find a more modern, code compatable grid to use that gives a clean 3D look like DBGrid32, etc. I quess I'll have to stick with this control because it would take a major rewrite unless there was a dropin replacement or upgrade.

Anyway, one of the things that I want to do on the pages that use this unbound grid is to be able to click the heading of a column and have it sort by that column in Ascending order. This grid doesn't seem to want to let me do this. Is it possible? How? I've done this several times when using other grids but they all used data controls as there datasource. Can someone help here?

Thanks,
Rev. Michael L. Burns
wwavgnu@inwave.com

Clunietp
Jun 26th, 2000, 12:00 PM
Is there a HeadClick event that you can capture or any event that is similar?

Gen-X
Jun 26th, 2000, 12:13 PM
I usually use the msflexgrid when doing non-DB stuff (even though it has the ability to be Data bound).

Rev. Michael L. Burns
Jun 26th, 2000, 10:06 PM
Clunietp,

I believe that is the problem. It doesn't seem to have a Header_Click Event.

Gen-X,

I took your lead an am using MSFlexGrid and it seems to wook fine with one exception. The original project used Grid32 and needed to zero out the grid (Clear). It used the following code:

' Clear text from the nonfixed cells ' grdSermons.SelStartCol = 0
grdSermons.SelStartRow = 1
grdSermons.SelEndCol = grdSermons.Cols - 1
grdSermons.SelEndRow = grdSermons.Rows - 1 grdSermons.FillStyle = 1
grdSermons.Text = ""
grdSermons.FillStyle = 0
grdSermons.SelEndCol = 0
grdSermons.SelEndRow = 1

I have to comment out this code in order for the project to work but the information does not format properly because it hasn't been cleared.

MSFlexGrid does not seem to use the SelStartCol, SelStartRow, SelEndCol and SelEndRow. IS there a way to immulate the following code?

Also, would you have an example how to sort the FlexGrid by clicking on the column header.

Thanks,
Rev. Michael L. Burns



[Edited by Rev. Michael L. Burns on 06-27-2000 at 01:08 PM]