Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
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

var
SelRect : TRect;
begin
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.top + Grid1.Height;
Grid1.Selection := TGridrect(SelRect) ;
end;

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
  #2  
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

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

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
Reply

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.