Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TLMDDBGrid record selection problem

TLMDDBGrid shows various problems when selecting records using the mouse. All of them seems to appear when the user drags the mouse under the grid's bottom border.

See the very simple attached demo program and this video :

- at the very beginning you can see an empty grid, this is caused by another problem I've already filed a request for (the grid should contain 10 records).
- after disabling opEditing you can see the inserted records and the range selection without rowselect (this is just to show normal behaviour).
- then I've disabled opRangeSelect and here you can see that dragging the mouse under the grid's bottom border, it scrolls up and the last record shown is actually the first one (contains Test 1), then moving the mouse up you can see a sort of range selection that's completely weird.
- at the end, I've enabled opRowSelect and again very strange behaviour can be seen when dragging the mouse down and up again.

Moreover, in another test I've done after recording the video, strange effects are visible also with the default settings (opRowSelect unchecked and opRangeSelect checked) if you drag the mouse down and up, so the problem isn't caused by row select or range select, it's here anyway.

zip
zip
TEST LMDDBGrid selection.zip
5K
Tagged:

Comments

  • 21 Comments sorted by Votes Date Added
  • Confirmed. But fixing this will take considerable time.
  • Bug will be moved to LMD 2018 issue tracker (https://git.lmd.de/customer/lmdvcl/issues/2). 
    If you have LMD Git-access, you can follow up progress there, otherwise please wait for the next minor release.
  • Hello, I've tested the last release but nothing changes.
    Any news on this bugs? 
    Thank you.
  • Hi,

    Its unfortunately impossible to support multi-select in data-aware version of the grid; I've forgot to remove this possibility. Please use our new feature - row checking instead:

    Row checking feature added. Row checks are shown directly inside indicator column.
    - New opShowRowChecks option for showing hiding row check-boxes.
    - New CheckIndicatorWidthCheckedCellBgColorCheckedCellTextColor properties in Grid.Style object. Color properties can be set to clNone to preserve default cell colors.
    - New IsRowChecked[Index: Integer] property for simple (non db-aware) grid. Row checks are stored internally in default data store.
    - New OnGetRowChecked/OnSetRowChecked events for db-aware grid. Row checks should be stored externally (dictionary can be used in user's code, for example).
  • Hello, 
    as mentioned before :

    "then I've disabled opRangeSelect and here you can see that dragging the mouse under the grid's bottom border, it scrolls up and the last record shown is actually the first one (contains Test 1), then moving the mouse up you can see a sort of range selection that's completely weird."

    This problem persists.
    Thank you.
  • edited July 2018 Posts: 38Vote Up0Vote Down
    Hi.

    The neopShowRowChecks option gives an error as soon as I try to check it. Try new VCL project, new TLMDDBGrid, try to check opShowRowChecks, this is what I get:

    image

    What's going wrong here?

    Thank you.
  • Hi,

    The issue "The neopShowRowChecks option gives an error as soon as I try to check it." is fixed.
  • Hi,

    The opShowRowChecks now works, thanks. But there's another problem now, the event OnDblClick on the grid doesn't fire anymore. I want to use double click to select the row (my users are used to this practice).

    Can you investigate this please?

    Thank you.
  • DblClick activates inplace editor. How you used it to select row?
  • edited August 2018 Posts: 38Vote Up0Vote Down
    By setting the grid's option opEditing to False. In LMD 2017 (as in delphi's own TDBGrid) this way a double click fires the OnDblClick event.
  • Thank you. I've just compared the sources between 2017 and 2018, it seems you've eliminated the "inherited" from the new code, there's a comment saying it caused problems. However this way other mechanisms in the ancestor are inhibited, among these is the double click handling.
  • I've reverted the possibility to use OnDblClick.
  • Thank you, it seems ok now.
  • Just as a reminder, there is still the problem with selection:

    "then I've disabled opRangeSelect and here you can see that dragging the mouse under the grid's bottom border, it scrolls up and the last record shown is actually the first one (contains Test 1), then moving the mouse up you can see a sort of range selection that's completely weird."

    Thank you.
  • I thinking, may be just disable dragging mouse effect when opRangeSelect  is not specified in options?
  • Maybe. Actually delphi's DBGrid doesn't scroll if you drag the mouse on the grid. Whould you implement this fix? I'll be glad to test it.

    By the way, if I've understood correctly, opRangeSelect shouldn't be available for TLMDDBGrid, right?
  • > Whould you implement this fix? I'll be glad to test it.

    Yes, I"ll try.

    > By the way, if I've understood correctly, opRangeSelect shouldn't be available for TLMDDBGrid, right?

    There no technical ways to implement it correctly on the top of Delphi's abstract TDataSet functionality.
  • >> By the way, if I've understood correctly, opRangeSelect shouldn't be available for TLMDDBGrid, right?
    >There no technical ways to implement it correctly on the top of Delphi's abstract TDataSet functionality.

    Sorry, maybe I said that badly. I meant, shouldn't the opRangeSelect option be REMOVED from the list of options available on the TLMDDBGrid, in order to prevent others from using it?
  • Yes, you right. I will disable it in some way. May be the simplest way is raising exception on attempt to actiavate the option.
Sign In or Register to comment.