Jump to content

Dbgrid selection problem


eduardosuruagy

Recommended Posts

Hello

Please change H_OnCellClick in UniBasicGrid.pas to below code for now. We will add this to new build.

 

procedure TUniBasicGrid.H_OnCellClick(This: TJSObject; EventName: string; Params: TUniStrings);
begin
  if Assigned(OnClick) then
  begin
    if CheckBoxSelect and (Params['c'].AsInteger=0) then
      Exit;
    FSelectionInvalid := True;
    try
      if Clickable(FCurrCol, FCurrRow) then
        OnClick(Self);
    finally
      FSelectionInvalid := False;
    end;
  end;
end;

 

Link to comment
Share on other sites

17 minutes ago, Hayri ASLAN said:

Hello

Please change H_OnCellClick in UniBasicGrid.pas to below code for now. We will add this to new build.

 


procedure TUniBasicGrid.H_OnCellClick(This: TJSObject; EventName: string; Params: TUniStrings);
begin
  if Assigned(OnClick) then
  begin
    if CheckBoxSelect and (Params['c'].AsInteger=0) then
      Exit;
    FSelectionInvalid := True;
    try
      if Clickable(FCurrCol, FCurrRow) then
        OnClick(Self);
    finally
      FSelectionInvalid := False;
    end;
  end;
end;

 

Worked, thank you!!

As for the line selection, how can the line be selected without me having to register? Note that dbgrid only selects the line if the record is marked, I would like to know which line the cursor is positioned on without having to mark.

Link to comment
Share on other sites

  • 5 months later...
On 10/8/2019 at 2:08 PM, Hayri ASLAN said:

Hello

Please change H_OnCellClick in UniBasicGrid.pas to below code for now. We will add this to new build.

  


procedure TUniBasicGrid.H_OnCellClick(This: TJSObject; EventName: string; Params: TUniStrings);
begin
  if Assigned(OnClick) then
  begin
    if CheckBoxSelect and (Params['c'].AsInteger=0) then
      Exit;
    FSelectionInvalid := True;
    try
      if Clickable(FCurrCol, FCurrRow) then
        OnClick(Self);
    finally
      FSelectionInvalid := False;
    end;
  end;
end;

 

Hasn't that been adjusted yet? I have to adjust it in all versions that I update from Unigui. How can I leave it fixed?

Link to comment
Share on other sites

  • 7 months later...
On 10/8/2019 at 2:08 PM, Hayri ASLAN said:

Hello

Please change H_OnCellClick in UniBasicGrid.pas to below code for now. We will add this to new build.

 


procedure TUniBasicGrid.H_OnCellClick(This: TJSObject; EventName: string; Params: TUniStrings);
begin
  if Assigned(OnClick) then
  begin
    if CheckBoxSelect and (Params['c'].AsInteger=0) then
      Exit;
    FSelectionInvalid := True;
    try
      if Clickable(FCurrCol, FCurrRow) then
        OnClick(Self);
    finally
      FSelectionInvalid := False;
    end;
  end;
end;

 

I have a similar problem, this time when I click on the grid's plus button to expand the line using dbgrid_RowExpand

Link to comment
Share on other sites

16 hours ago, Farshad Mohajeri said:

 

Uma correção implementada.

 

18 hours ago, Farshad Mohajeri said:

Você lida com o evento OnClick da grade?

Por que você não usa colunas de ação com evento OnColumnActionClick? Será mais preciso e não causará tais problemas.

I'm using the grid's onClick, how can I use the OnColumnActionClick?

Link to comment
Share on other sites

  • 1 month later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...