|
----- Original Message -----
Sent: Friday, June 23, 2006 9:28 AM
Subject: [lazarus] TStringGrid
Question
I am using a TStringGrid in a project that I am working on. I have
a few questions about the use of this and all my delphi books seem to delve
into DBGrids but not string grids. Here are my
questions:
1. My grid would allow the user to enter data in the
first column while the other columns show result based on the data just
entered. How do I selectively restrict data entry to a
column/row/cell? 2. If the user presses enter while in a cell, the
cell to the right of the previous one is selected. How do I change this
so that the one below is active? 3. What is the best event to use for
updating a running total as the user enters data? In other words, the
user has entered a number and gone to the next cell, I want to do a summation
and present the new total.
Thanks! Matt Henley
1. Create a
OnSelectEditor event and set there: if Col<>1 then
Editor:=nil;
2. in Object inspector set
AutoAdvance:=aaDown
3. Create a OnEditingDone event there you can
recalc the total.
Note: OnEditingDone may be triggered
some times at the grid setup after that
is triggered
when user ends editing.
Jesus Reyes A.
|