Oleg Tegelmann
Oleg Tegelmann

Reputation: 51

EhLib DBGridEh Scrolling Troubles


I use EhLib DBGridEh in my application and I've troubles with highliting when I start scrolling it using Scrollbar.
If I don't select cell in the grid than highliting will work correctly.
But if I select cell and start scrolling using ScrollBar than there will be highlited only one cell instead of whole raw and previous raw will be highlited too.
These you can see on picture.
Scrolling bug

Just few weeks ago I have the same situation when I scrolled grid using mouse wheel. This issue I resolved by adding handling of application messages.

procedure TMainForm.AppEventHandlerMessage(var Msg: tagMSG;
  var Handled: Boolean);
var
   i: SmallInt;
begin
   if Msg.message = WM_MOUSEWHEEL then
   begin
     Msg.message := WM_KEYDOWN;
     Msg.lParam := 0;
     i := HiWord(Msg.wParam) ;
     if i > 0 then
       Msg.wParam := VK_UP
     else
       Msg.wParam := VK_DOWN;

     Handled := False;
   end;
end;

There is the full list of the properties that are enabled in my grid:
Options

  1. dgEditing
  2. dgTitles
  3. dgIndicator
  4. dgColumnResize
  5. dgColLines
  6. dgRowLines
  7. dgTabs
  8. dgAlwaysShowSelection
  9. dgMultiSelect

OptionsEh

  1. dghFixed3D
  2. dghResizeWholeRightPart
  3. dghHighlightFocus
  4. dghClearSelection
  5. dghMultiSortMarking
  6. dghEnterAsTab
  7. dghRowHighlight

Upvotes: 1

Views: 2662

Answers (1)

dmitryb
dmitryb

Reputation: 21

It is a feature of the DBGridEh. If it have multiselected area it stop rowhighlighting to avoid misunderstanding between seleced area and highlighting cells of the current row.

DmitryB

Upvotes: 2

Related Questions