Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 184
  • Last Modified:

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.
0
setankabir
Asked:
setankabir
  • 2
  • 2
1 Solution
 
Amir AzhdariCommented:
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
0
 
esoftbgCommented:
By Object Inspector
 Property: - Options
        Set:     dgMultiSelect to False
0
 
esoftbgCommented:
 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.
0
 
Amir AzhdariCommented:
>In multiselect mode, HOW TO PREVENT MULTISELECTION ON COLUMNS , but allow multiselection on rows?

the Answer is :


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;
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now