Antony R.
2016-04-24T22:21:34Z
Hello again.

I have a column that is created like this :

Grd.AddCol sKey:="SubExamName", sHeader:="Exam", lWidth:=175,  eSortType:=igSortByValueCustomGroups

When I use the "Group by this column" menu item in igrid build in header menu, CustomGroupValue is triggerd and custom groupping is occured ok.
When I try to reproduce this by code (use my own menus), the CustomGroupValue is not triggered.

  Grd.GroupObject.Clear
  Grd.GroupObject.AddItem "SubExamName", igSortAsc, igSortByValueCustomGroups
  Grd.Group True

After code executed, if I click the column (aka sort), CustomGroupValue triggers.
Grd.Sort will not trigger it also.

What am I doing wrong?
Igor/10Tec
2016-04-25T08:15:50Z
Strange... I can't reproduce this. Can you send me a simple sample to demonstrate the problem? You can use a command button instead of your custom menu for simplicity.
Antony R.
2016-04-25T11:52:47Z
Originally Posted by: Igor/10Tec 

Strange... I can't reproduce this. Can you send me a simple sample to demonstrate the problem? You can use a command button instead of your custom menu for simplicity.



It becomes even stranger...
After several tests I have run into the safe conclusion that when the "Groupby sub" is called from a button, everything works ok.
If exactly the same sub is called from Access popup menu or even iGrids custom menus, there is no trigger to the CustomGroupValue.
(As I mentioned before, from the standard menus everything works ok)

Here is an example:   db50.zip (15kb) downloaded 87 time(s).
(original external DropBox link: MDB Test File )

Please open “Form1”.
Group By, from header standard menu, triggers the event.
Group By, from command button, triggers the event.
Group By, from cells custom created menu, does not trigger the event.

P.S. I’m in a trial period and I am using the demo version.
Igor/10Tec
2016-04-25T14:28:35Z
This is a glitch of MS Access. The problem is not in the CustomGroupValue event or the internal implementation of the grouping routine. The problem is that MS Access "disconnects" a 3rd-party ActiveX control from its event handlers if we try to do something from a context menu. To prove that, add one more iGrid event handler that must work during grouping:

Private Sub iGrid0_AfterAutoGroupRowCreated(ByVal lRow As Long, ByVal lItemCount As Long, ByVal vAggrFuncValues As Variant)
   MsgBox "iGrid0_AfterAutoGroupRowCreated Trigered"
End Sub

This code snippet isn't executed too if you group the grid from a context menu.
Antony R.
2016-04-25T20:11:00Z
Originally Posted by: Igor/10Tec 

This is a glitch of MS Access. The problem is not in the CustomGroupValue event or the internal implementation of the grouping routine. The problem is that MS Access "disconnects" a 3rd-party ActiveX control from its event handlers if we try to do something from a context menu. To prove that, add one more iGrid event handler that must work during grouping:

Private Sub iGrid0_AfterAutoGroupRowCreated(ByVal lRow As Long, ByVal lItemCount As Long, ByVal vAggrFuncValues As Variant)
   MsgBox "iGrid0_AfterAutoGroupRowCreated Trigered"
End Sub

This code snippet isn't executed too if you group the grid from a context menu.



Thanx!
Is there a way of altering the choices of the build in menu?
It would be great if I could change the language.


Igor/10Tec
2016-04-26T07:20:30Z
Did you implement your custom header menu just to localize the built-in one?

There is a simpler way to localize iGrid - the UIStrings indexed property. To localize the built-in column header context menu, use the indices from 1 to 5 (see the documentation).
Igor/10Tec
2016-11-10T11:34:41Z
A solution to this problem has been found. Read this KB article:

iGrid events are not always raised in MS Access