How to move a column to the GroupBar using Keyboard

Posted by: mikedempsey on 8 September 2017, 2:24 pm EST

  • Posted 8 September 2017, 2:24 pm EST

    For Section 508 compliance I need to provide a way to execute all functions via the keyboard.


    I have searched the documentation and Intellisense but can not find a way to add a column to the Group Bar using the keyboard.


    I am able to switch on (display) the Group bar but after that I have to double click a header cell or drag a header to the bar.
    Both of these requires use of the mouse.


    I looked at the Keyboard mappings but I dont see an action defined to do this via Input mappings either.


    Is there any way to do this?


    Thanks
    Mike 

  • Replied 8 September 2017, 2:24 pm EST

    Thanks.


    However I can add a keyboard shortcut myself.


    I was looking for a way to programatically add a column to the group bar when someone uses my shortcut.
    Is there no way to add a column using code?


    Thanks
    Mike


     

  • Replied 8 September 2017, 2:24 pm EST

    Hello Mike,

    Yes, you can programatically add a column to GroupBar using code given below:-

    Dim gm As New FarPoint.Win.Spread.Model.GroupDataModel(FpSpread1.Sheets(0).Models.Data)
    Dim si() As FarPoint.Win.Spread.SortInfo = New FarPoint.Win.Spread.SortInfo() {New FarPoint.Win.Spread.SortInfo(0, True)}
    gm.Group(si)
    FpSpread1.Sheets(0).Models.Data = gm

    Hope this will help you. Thanks.

  • Replied 8 September 2017, 2:24 pm EST

    Hello Mike,


    I didn't find anyway to move column in GroupBar using Keyboard as of now. However, I have added it as feature request for future release of Spread and the feature request Id for the same is #99917319.


    Thanks.

  • Replied 8 September 2017, 2:24 pm EST

    Great, thanks, that worked.


    This does not fire the Grouping or Grouped events so I will need to manually call these functions before/after doing this. 

  • Replied 8 September 2017, 2:24 pm EST

    Yes,

    You would need to manually call it as it doesn't fire Grouping or Grouped events.

    Thanks.

  • Replied 8 September 2017, 2:24 pm EST

    The code above works only if there are not already columns on the group bar, so full support is rather more complicated.


    However I now have code that allows me to manually add columns to the group bar (by setting the model as above, or by increasing the size of the Groups() array and assigning the new column to the added member).


    I also added code to make sure the column was not already there - Spread checks for duplicates when I drag it but it allows me to manually add the same column multiple times - resulting in a very strange display.


    I also use OnGrouping to fire my Grouping event handler, and moved the Grouped event handler code to my own function so that I can pass a switch that tells me if the group was done by the user or via code.


    Took a little trial and error to determine exactly when OnGrouping should be called, but everything seems to be working fine now.


    Thanks
    Mike

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels