Steve Lapides
2019-11-12T17:09:35Z
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
.Clear
.AddItem 2
End With
iGrid3.Group

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

Click to View Image16 View(s)

Igor/10Tec
2019-11-13T06:45:48Z
Please, send us a sample to reproduce this issue.
Steve Lapides
2019-11-13T19:03:16Z
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 DLL.zip (5kb) downloaded 13 time(s).  Test Project.zip (34kb) downloaded 13 time(s).
Steve Lapides
2019-11-13T20:25:14Z
I forgot to pull out all the Protoview stuff in the project. New one is attached.  Test Project.zip (7kb) downloaded 14 time(s).
Igor/10Tec
2019-11-14T16:12:31Z
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
2019-11-15T15:52:59Z
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?
Igor/10Tec
2019-11-18T06:27:48Z
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.

Quote:

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
2019-11-18T13:33:41Z
Sorry about that. He's an updated project with that stuff removed.  Test Project.zip (7kb) downloaded 13 time(s).
Steve Lapides
2019-11-25T13:20:38Z
Igor, did you forget about this one? Plus I have two other items waiting for an response.
Igor/10Tec
2019-11-26T08:08:46Z
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
2019-11-27T21:48:19Z
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.