Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Thread Tools Display Modes
Old 11-10-2005, 10:19 PM
digitiger digitiger is offline
Senior Member
Join Date: Jan 2001
Posts: 716
Default Problem with StringGrid.Selection

I am using the following procedure to select all the columns and rows excluding Fixed rows & columns (1Fixed row and 2 Fixed columns) in a StringGrid as below

SelRect : TRect;
Selrect.Left := Grid1.Left + (Grid1.ColWidths[0]+Grid1.ColWidths[1]);
Selrect.Right := Grid1.Left + Grid1.Width;
SelRect.Top := Grid1.Top + Grid1.RowHeights[0];
Selrect.Bottom := + Grid1.Height;
Grid1.Selection := TGridrect(SelRect) ;

but it just does not works.Though no error message is shown and while tracing all the values are as expected but nothing is shown as selected on the grid

Kindly tell me as what am I doing wrong

Thanks a lot in advance
Reply With Quote
Old 11-10-2005, 11:18 PM
mshkolnik mshkolnik is offline
Senior Member
Join Date: Jul 2001
Posts: 4,195
Default RE: Problem with StringGrid.Selection

gc: TGridCoord;
gc.TopLeft.X := 2;
gc.TopLeft.Y := 0;
gc.BottomRight.X := yourStringGrid.ColCount-1;
gc.BottomRight.Y := yourStringGrid.RowCount-1;
yourStringGrid.Selection := gc

With best regards, Mike Shkolnik
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

All times are GMT. The time now is 11:50 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.