Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 18 Location: Vienna, Virginia
|
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. 
|
|
|
|
Rank: Administration
Groups: Administrators, Forum Moderator Joined: 1/17/2011(UTC) Posts: 1,101
Thanks: 15 times Was thanked: 141 time(s) in 141 post(s)
|
Please, send us a sample to reproduce this issue.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 18 Location: Vienna, Virginia
|
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 1 time(s). Test Project.zip (34kb) downloaded 1 time(s).
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 18 Location: Vienna, Virginia
|
I forgot to pull out all the Protoview stuff in the project. New one is attached. Test Project.zip (7kb) downloaded 2 time(s).
|
|
|
|
Rank: Administration
Groups: Administrators, Forum Moderator Joined: 1/17/2011(UTC) Posts: 1,101
Thanks: 15 times Was thanked: 141 time(s) in 141 post(s)
|
I can't launch your project. I did compile IPDAS_iGrd.DLL, but the compilation of Form1 fails on the following line: Code: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?
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 18 Location: Vienna, Virginia
|
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?
|
|
|
|
Rank: Administration
Groups: Administrators, Forum Moderator Joined: 1/17/2011(UTC) Posts: 1,101
Thanks: 15 times Was thanked: 141 time(s) in 141 post(s)
|
I commented out that definition but got a next error 'ActiveX component can't create object' in Form_Load: Code: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.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 18 Location: Vienna, Virginia
|
Sorry about that. He's an updated project with that stuff removed. Test Project.zip (7kb) downloaded 1 time(s).
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 18 Location: Vienna, Virginia
|
Igor, did you forget about this one? Plus I have two other items waiting for an response.
|
|
|
|
Rank: Administration
Groups: Administrators, Forum Moderator Joined: 1/17/2011(UTC) Posts: 1,101
Thanks: 15 times Was thanked: 141 time(s) in 141 post(s)
|
I found the answer while debugging your code. See, you set the sort column to -1 in the Sort method of your CIGrid class: Code: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.
|
|
|
|
Rank: Member
Groups: Registered
Joined: 11/1/2019(UTC) Posts: 18 Location: Vienna, Virginia
|
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.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The 10Tec Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close