Grid - Pre Sale Questions
Selection Rectangle
Thread Starter: ricrat51 Started: 5/2/2008 1:15 AM UTC
Replies: 3
Selection Rectangle
Like Grid a lot.
Plan to buy if I work out some details. Developing prototype for grid to incorporate into existing app.
Used the old ALIGRID component.

What event should I use to determine the upper left and lower right cells of the selection.

In a different grid (ALIGRID) the OnClick event handler gave me the rectangle, Using either the mouse or keyboard but it appears that ProfGrid fires the OnClick as soon as the starting corner cell is clicked.
I discovered that I can use the MouseUp event to get the current selection,
What do I use when selecting with the keyboard.
Is there a common event?

Any help would be appreciated.
thanks


Re: Selection Rectangle
Hello ricrat51:

What event should I use to determine the upper left and lower right cells of the selection.

There is not a special event occurring when extending a multicell selected region, so use the OnIdle event of the TApplicationEvents component (from the Additional page of the Component palette).

procedure TForm1.ApplicationEvents1Idle(Sender: TObject;
 var Done: Boolean);
var
 SelectionRect: TGridRect;
begin
 SelectionRect := ProfGrid1.Selection.Rect;
 Caption := IntToStr(SelectionRect.Left)
  + ', ' + IntToStr(SelectionRect.Top)
  + ', ' + IntToStr(SelectionRect.Right)
  + ', ' + IntToStr(SelectionRect.Bottom)
end;

it appears that ProfGrid fires the OnClick as soon as the starting corner cell is clicked.

Please see http://www.profgrid.com/documentation/grid/hs2820.htm


-Nicholas
Re: Selection Rectangle
Thanks.
Another question.  When I extend a multi-cell selection the starting corner (either top left or bottom right) does not change color until the focus is moved to another control on the form.  Is this a design feature or am I
doing something weird.
See attachments below.

This message includes the following attachments:

Re: Selection Rectangle
You may include the pgoDrawFocusSelected option in the Options property.


-Nicholas