Link to home
Start Free TrialLog in
Avatar of setankabir
setankabir

asked on

How to prevent multiselection on columns, but allow multiselection on rows in DBGrid

In multiselect mode, how to prevent multiselection on columns, but allow multiselection on rows?

Thanks in advance


Actually I have asked this question, but nothing can answer it. So, I increase the difficulty point.
Avatar of Amir Azhdari
Amir Azhdari
Flag of United States of America image

just add a line to  oncreate event of your form :

procedure TForm1.FormCreate(Sender: TObject);
begin
tstringgrid(dbgrid1).Options:=[goFixedVertLine,goFixedHorzLine,goVertLine,goHorzLine,goRangeSelect,goColSizing,goThumbTracking];
end;

Regards
Azhdari
By Object Inspector
 Property: - Options
        Set:     dgMultiSelect to False
 Sorry, I did not read the question carefully....

DBGrid.Options := [dgEditing,dgAlwaysShowEditor,dgTitles,dgIndicator,dgColumnResize,dgColLines,dgRowLines,dgTabs,dgConfirmDelete,dgCancelOnExit,dgMultiSelect];

is impossible multiselection of columns, but it is possible multiselection of rows in DBGrid.
ASKER CERTIFIED SOLUTION
Avatar of Amir Azhdari
Amir Azhdari
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial