Xojo DataGrid by BasicApp

piDogs DataView has at least the hiding scrollbar, the elastic scrolling behaviour (why odd? I think it feels natural) and supports the user accent color. On Mac it looks and feels very native.

But i’m very happy that there is a new, interesting, alternative, thank you @Gabriele_Marchionni

2 Likes

Do you mean hides when there’s not enough data for scrolling to make sense, or hides when there’s no mouse hover? The former is sensible, the latter I loathe.

8 Likes

That’s a setting that you can control in Settings > Appearance on macOS if you’d like to always have the scrollbars visible in all applications.

Show scroll bars > Always

I didn’t realize that until I was painstakingly alighting stuff in the UI in an app and looked at it on someone else’s computer and saw that everything in the listboxes was pushed over to the left by the scrollbar track that wasn’t visible on mine.

Now I’ve learned to not be quite so obsessive. :wink:

2 Likes

I just fixed some requested things.

Fix:

  • Horizontal scrolling via a Trackpad or Shift+Scrollwheel.
  • Changed keyword “Head” with “Header”

Added properties:

  • MouseWheelHorizontalEnabled - To enable the horizontal scrolling
  • MouseWheelVerticalEnabled - To enable the vertical scrolling
3 Likes

Thank you, works great!

There is fair bit of customization you can achieve with just playing with colours (and transparency). Including a macOS-like header and hiding the scrollbars.

Hovering then makes the scrollbars appear:
BaDataGrid-scrollbars

1 Like

Your grid is looking really good :smiley:

But I did find one bug and an error.

The bug occurs when clicking the vertical scroll “knob” when it is at the top. When clicking the “knob” it also causes whatever column header that is underneath it to also sort.

The error happens if the grid is scrolled down to a lower position, then if you horizontally scroll so that last column’s width is fully visible (including if there is empty space to the right), and then scroll vertically up to the top. When you hit the top - the error occurs.

Yes, I can try to create a background paint event.

1 Like

Ok, I will try to fix the bug.
Thanks!

1 Like

The latter. Unfortunately, the users expect that nowadays.

1 Like

Ver. 1.08 - I just fixed some bugs and requested things.

Added and Fixed Events:

  • HeaderCellBackgroundPaint - Fires before to redraw the header cell (redraw background)
  • HeaderCellPaint - Fires after to redraw the header cell (redraw over)
  • RowsCellBackgroundPaint - Fires before to redraw the row cell (redraw background)
  • RowsCellPaint - Fires after to redraw the row cell (redraw over)

Bug fixed:

  • The bug occurs when clicking the vertical scroll “knob” when it is at the top
  • The NilObjectException error happens when the grid scrolled
5 Likes

Thank you very much @Gabriele_Marchionni, for the fast turnaround. Everything is working great!

I’m very happy with my purchase :nerd_face:

2 Likes

I need this before purchasing it:

https://tracker.xojo.com/xojoinc/xojo/-/issues/73256

2 Likes

I’m working on it.
Also on:

  • Footer
  • Footer field types: Sum, Average, Min, Max and Custom
  • Merging footer cells
  • Footer icons
  • Header icons
  • Picture cell types

Ver. 1.09 - I just fixed some bugs and requested things.

Added Properties:

  • BaDataGridColumn.HeaderIcon - Icon for header column
  • BaDataGridColumn.HeaderIconAlignment - Icon header alignment
  • BaDataGridColumn.HeaderAlignment - Text header alignment
  • HasFooter - To show the grid footer
  • DefaultFooterHeight - To set footer height
  • ColorFooterBack, ColorFooterBorder, ColorFooterText - To choose footer color
  • BaDataGridColumn.FooterIcon - Icon for footer column
  • BaDataGridColumn.FooterIconAlignment - Icon alignment
  • BaDataGridColumn.FooterAlignment - Text footer alignment
  • BaDataGridColumn.ValueMin - Minimum value calculated on all records
  • BaDataGridColumn.ValueMax - Maximum value calculated on all records
  • BaDataGridColumn.ValueAvg - Average value calculated on all records
  • BaDataGridColumn.ValueSum - Sum value calculated on all records
  • BaDataGridColumn.ValueCustom - Custom string value chosen by developer
  • BaDataGridColumn.FooterValueType - To choose the type of display (BaDataGrid.EnumFooterValueType)
  • BaDataGridColumn.FooterNumberFormat - Set the footer number format

Added Enum Types:

  • BaDataGrid.EnumFooterValueType = Nothing, Sum, Avg, Min, Max, Custom, Header

Added Events:

  • FooterCellBackgroundPaint - Fires before to redraw the footer cell (redraw background)
  • FooterCellPaint - Fires after to redraw the footer cell (redraw over)

Add Methods:

  • RowUpdate - To update database record manually

Fixed Properties:

  • BaDataGridColumn.Alignment - Fix the text alignment
  • BaDataGridColumn.TextMaxLength - Before was TextMaxLenght

Other fixed:

  • Fixed decimal separator character issue

4 Likes

Thank you, Gabriele, for the new features.

As a suggestion, I’m wondering, if and when you have time (no rush), is it possible to change the vertical scroll behaviour?

  • A. When scrolling content vertically, the grid appears to always move about 4 rows at a time, regardless if you are scrolling quickly or slowly. This behaviour appears to be the same whether using a trackpad, a mouse scrollwheel or manually moving the scrollbar with the mouse.
    Feature Request: It would be great, if scrolling slowly, if the grid could move just 1 row at a time.

  • Observation: Using the up/down arrow keys on a selected row moves the selection 1 row at a time (which is great), but when moving up or down the list and the selected row goes beyond the top or bottom of the grid - the grid does not move to keep the selected row visible.

  • B. The length of the horizontal scrollbar appears proportionally correct (for the number of columns not visible).
    But, the vertical scrollbar size appears to be always the same small size, regardless of how many rows are not visible.
    In the attached screen-shot, I modified the query to only return 30 records, but the vertical scrollbar is still small. Ideally, it should be about 2/3 of the height of the grid.
    Feature Request: Make the height of the vertical scrollbar more proportional (by number of visible vs. none-visible rows).
    Alternative option: Make the pixel height of the vertical scrollbar an editable property.

Thank you for considering my suggestions.

2 Likes

Thanks for the new features!

I’ll work on these too.
Thanks Scott

2 Likes

No smooth scrolling in macOS … so it lost my intrest.

1 Like

Hi @ChristopheDV,
can you give me an example of a grid with smooth scrolling? So I will take that as a reference.
Xojo lists do not have the smooth scrolling, so even from another software not Xojo.
Thanks.

In Xcode you can useNSTableView for this. I guess every app the has a datagrid does use this for macOS.
Apple itself uses this in Numbers (Excel-a-like).
It will give the app a native feeling. For many (most?) macOS users this is important.

FWW SwiftDataGrid is a free control and uses NSTableView.

1 Like