Solved

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

Posted on 2004-09-18
4
175 Views
Last Modified: 2010-04-05
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
Comment
Question by:setankabir
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:Amir Azhdari
ID: 12093131
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
 
LVL 12

Expert Comment

by:esoftbg
ID: 12093155
By Object Inspector
 Property: - Options
        Set:     dgMultiSelect to False
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 12094360
 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
 
LVL 6

Accepted Solution

by:
Amir Azhdari earned 300 total points
ID: 12094439
>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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question