Jump to content

dbgrid actual row


jahlxx

Recommended Posts

hi.

 

in a unidbgrid, whet I click in a row, that row becomes the actual row.

 

but, when I right click in a row, that row not becomes the actual row, I need to do click before.

 

is this a problem of unidbgrid?

 

thanks.

Link to comment
Share on other sites

Ok. Sorry guys !!!

 

The problem is that I have this code in the form that contains the grid.

 

var

lastx, lasty: integer;

begin

if Button=mbRight then

begin

LastX:=X;

LastY:=Y;

menu.Popup(X, Y, WebForm.JSForm);

end;

end;

 

 

Is a trick published in this forum because the grid don't have the popupmenu property.

 

I have solved with context click of the grid.

 

thanks and sorry again

Link to comment
Share on other sites

Only one thing.

 

As I can see, the contextclick in the grid only works if the grid has data. If I right click in a zone of the gris with no data, or the grid is empty, the right click does nothing.

 

Ani idea?

 

Thanks.

Link to comment
Share on other sites

for example:

1.

procedure TMainForm.UniDBGrid1CellContextClick(Column: TUniDBGridColumn; X,
  Y: Integer);
begin
  if ClientDataSet1.State in dsEditModes then
    UniPopupMenu2.Popup(X, Y)
  else
    UniPopupMenu1.Popup(X, Y);
end;

2. UniDBGrid1->ClientEvents->ExtEvents ... containercontextmenu fn:

function containercontextmenu(sender, e, eOpts)
{
  ajaxRequest(this, 'cellcontextmenu', ['ex='+e.getXY()[0], 'ey='+e.getXY()[1]]);
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...