jahlxx Posted July 9, 2016 Share Posted July 9, 2016 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. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted July 9, 2016 Administrators Share Posted July 9, 2016 Hi, I can not reproduce this. Right clicking on a cell will make it current row. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 9, 2016 Share Posted July 9, 2016 but, when I right click in a row, that row not becomes the actual row, I need to do click before. Can you clarify ?! Right click works correctly Quote Link to comment Share on other sites More sharing options...
jahlxx Posted July 10, 2016 Author Share Posted July 10, 2016 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 Quote Link to comment Share on other sites More sharing options...
jahlxx Posted July 11, 2016 Author Share Posted July 11, 2016 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 11, 2016 Share Posted July 11, 2016 Hi, You can use this function: function containercontextmenu(sender, e, eOpts) Quote Link to comment Share on other sites More sharing options...
jahlxx Posted July 11, 2016 Author Share Posted July 11, 2016 can you paste a sample, please? thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 11, 2016 Share Posted July 11, 2016 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]]); } Quote Link to comment Share on other sites More sharing options...
jahlxx Posted July 12, 2016 Author Share Posted July 12, 2016 ok. thanks. how can I add the containercontextmenu function in run-time? thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.