Steve Lapides
I'm trying to understand grouping with a test project. I'm using this code to group the attached table by the Inventor column:

With iGrid3.GroupObject
.AddItem 2
End With

I get a runtime error "Subscript out of Range" on the last statement.

Click to View Image29 View(s)

Please, send us a sample to reproduce this issue.
Steve Lapides
The test project zip had the VB6 source plus a DLL built to work with it. The other zip is the source of that DLL, though it doesn't oome into play for this issue. Launch the test project, then hit the Group button that's in the middle frame.  Custom iGrid (5kb) downloaded 24 time(s).  Test (34kb) downloaded 24 time(s).
Steve Lapides
I forgot to pull out all the Protoview stuff in the project. New one is attached.  Test (7kb) downloaded 25 time(s).
I can't launch your project. I did compile IPDAS_iGrd.DLL, but the compilation of Form1 fails on the following line:

Dim dt As New IPDAS_Datatable.CDatatable

Is it possible to reproduce the problem in a simple project with one form containing iGrid without any dependencies? If not, may it mean that the problem is somewhere in your custom DLLs?
Steve Lapides
Oops. That's a Protoview thing. Remove it.

Another totally unrelated question. Is there any way to control the formatting of the check mark for checkboxes? Like a font.bold attribute?
I commented out that definition but got a next error 'ActiveX component can't create object' in Form_Load:

Private Sub Form_Load()

Dim dp As Object
Set dp = CreateObject("DirectoryPaths.CDirectoryPaths")
DocDescIni = dp.DataDir & "Common\EFSWeb Document Descriptions.ini"
PFDir = dp.ProgramFilesDir

Please, recreate the problem in a brand new sample with iGrid only. If it is a problem on the side of iGrid, you will be able to reproduce the problem easily with several rows of your data you showed earlier.


Another totally unrelated question. Is there any way to control the formatting of the check mark for checkboxes? Like a font.bold attribute?

We use one thread to discuss just one problem. Re-ask this question in a new thread with the corresponding topic. If possible, upload a screenshot of you want to get.
Steve Lapides
Sorry about that. He's an updated project with that stuff removed.  Test (7kb) downloaded 24 time(s).
Steve Lapides
Igor, did you forget about this one? Plus I have two other items waiting for an response.
I found the answer while debugging your code. See, you set the sort column to -1 in the Sort method of your CIGrid class:

Public Sub Sort(Optional iGrid As Object = Nothing, _
  Optional PrimaryCol As Long = -1, _
  Optional SecondaryCol As Long = -1, _
  Optional TertiaryCol As Long = -1)

If Not iGrid Is Nothing Then Set MyiGrid = iGrid

With MyiGrid.SortObject
    .ColCount = 1
    .SortOrder(1) = igSortAsc
    .SortType(1) = igSortByValueGeneral
    .SortCol(1) = PrimaryCol

When you call the Group method of iGrid, iGrid is also sorted according to the specified sort criteria. At this point it finds the improper column with the index -1 and reports about that with the error.
Steve Lapides
Thanks. I found that same bug since I sent this to you and already fixed it. Now the grouping is working. I never retried this test project since I fixed that bug a few days ago.