Roberto Nicchi Posted September 29, 2022 Share Posted September 29, 2022 Hello, i'm using a TuniDBgrid component to allow selection of multiple records. Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgRowSelect, dgCheckSelect, dgAlwaysShowSelection, dgConfirmDelete, dgMultiSelect, dgAutoRefreshRow] My problem is that the record selection is possible only clicking in the checkbox only. I would like to select/unselect the record clicking in any column of the grid. Possible in some way ? thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 29, 2022 Share Posted September 29, 2022 7 minutes ago, Roberto Nicchi said: My problem is that the record selection is possible only clicking in the checkbox only. I would like to select/unselect the record clicking in any column of the grid. Possible in some way ? Hello, "Use Ctrl/Shift to select multiple records (Ctrl-A to select all)" \FMSoft\Framework\uniGUI\Demos\Desktop\GridMultiSelect Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted September 29, 2022 Author Share Posted September 29, 2022 37 minutes ago, Sherzod said: Hello, "Use Ctrl/Shift to select multiple records (Ctrl-A to select all)" \FMSoft\Framework\uniGUI\Demos\Desktop\GridMultiSelect The application will be used in a touch monitor. The user click (touch) the record and it should be selected. thanks Roberto Quote Link to comment Share on other sites More sharing options...
irigsoft Posted September 29, 2022 Share Posted September 29, 2022 15 minutes ago, Roberto Nicchi said: The application will be used in a touch monitor. The user click (touch) the record and it should be selected. thanks Roberto Hello, try to create procedure like Example : GridMultiSelect to check checkbox when user click on DBGrid Row (Work on uniDBGridClick, uniDBGridDBlClick,OnCellClick) var selActControl : TControl; begin if Column <> nil then begin if not Column.ActionColumn.Enabled then // procedure to check selected row from example //TUniDBGrid (TUniDBGridColumn (Column).Grid).; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 29, 2022 Share Posted September 29, 2022 1 hour ago, Roberto Nicchi said: The user click (touch) the record and it should be selected. Yes, it's possible I guess, I will check. Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted September 29, 2022 Author Share Posted September 29, 2022 2 hours ago, irigsoft said: Hello, try to create procedure like Example : GridMultiSelect to check checkbox when user click on DBGrid Row (Work on uniDBGridClick, uniDBGridDBlClick,OnCellClick) var selActControl : TControl; begin if Column <> nil then begin if not Column.ActionColumn.Enabled then // procedure to check selected row from example //TUniDBGrid (TUniDBGridColumn (Column).Grid).; end; I can't understand how to change the selection of the current record by code. I i had this information it would be easy... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 29, 2022 Share Posted September 29, 2022 @Roberto Nicchi Try this approach: procedure TMainForm.UniFormReady(Sender: TObject); begin UniDBGrid1.JSInterface.JSCall('getSelectionModel().setSelectionMode', ['SIMPLE']); end; Quote Link to comment Share on other sites More sharing options...
Roberto Nicchi Posted September 30, 2022 Author Share Posted September 30, 2022 19 hours ago, Sherzod said: @Roberto Nicchi Try this approach: procedure TMainForm.UniFormReady(Sender: TObject); begin UniDBGrid1.JSInterface.JSCall('getSelectionModel().setSelectionMode', ['SIMPLE']); end; It works perfectly, 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.