Adding a grouping column?

ActiveX

ActiveX controls

Adding a grouping column?

  • rated by 0 users
  • This post has 4 Replies |
  • 2 Followers
  • The documentation for both Add and GroupColumns says the syntax is: object.Add (item) so I did this: TDBGrid1.GroupColumns.Add(TDBGrid1.Columns("Portfolio")). This complains that "argument not optional". Looking at the tooltip that pops up, it appears I need an "Index as Integer" so I changed it to TDBGrid1.GroupColumns.Add(0, TDBGrid1.Columns("Portfolio")), but according to VB, this is a syntax error. I solved that with x = TDBGrid1.GroupColumns.Add(0, TDBGrid1.Columns("Portfolio")), but now the resulting grid is grouped by column 0, not "Portfolio". So what is the proper syntax for this?
  • Also, the documentation states that you need DataView=2 and AllowColMove=True. It appears that AllowColSelect=True must also be on?
  • GroupCol.zip

    Hello,

     

    Regarding your query on GroupColumn property of TrueDBGrid, I  am attaching a sample project that will illustrate the same. In this sample application we have not set the AllowColSelect to true however the AllowColMove should be set to true.

     

     

    Regards,

    Gary

     

    <maurymarkowitz> wrote in message news:203769@10.0.1.98...
    The documentation for both Add and GroupColumns says the syntax is: object.Add (item) so I did this: TDBGrid1.GroupColumns.Add(TDBGrid1.Columns("Portfolio")). This complains that "argument not optional". Looking at the tooltip that pops up, it appears I need an "Index as Integer" so I changed it to TDBGrid1.GroupColumns.Add(0, TDBGrid1.Columns("Portfolio")), but according to VB, this is a syntax error. I solved that with x = TDBGrid1.GroupColumns.Add(0, TDBGrid1.Columns("Portfolio")), but now the resulting grid is grouped by column 0, not "Portfolio". So what is the proper syntax for this?

    http://helpcentral.componentone.com/cs/forums/p/74928/203769.aspx#203769

  • "In this sample application we have not set the AllowColSelect " Uhhh, yes it is... and turning if off makes grouping fail :-) I'd really prefer to have a completely separate switch for this, AllowColGrouping, that would allow it in spite of the other two settings.
  • I'm having the same problem. I tried downloading your example but there is no example code to answer this question. What is the proper use of the GroupColumns.Add()? It doesn't work as advertised. I had the exact same result as Maury, that is on the first call to the GroupColumns.Add() routine it added the 0 column, not the one I wanted, and the second call aways fails, says Invalid index for any index I try. 

Page 1 of 1 (5 items)