Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

TstringGrid useage

Hi all,
As you will see, I'm pretty new to this stuff.
I need to allow end user to input a bunch of parameters, both numeric and string, for a large number of similar objects. The easiest way I can see to present this is with a TStringGrid that the user simply fills in. How do I do the following:

1: Detect if the user has moved from one cell to another? I would use this to validate the data that was entered.

2: Set the data type to integer, real or string on a column basis.

Any help will be appreciated

Thanks

Brendon


Brendon Parise
Wannabee software writer

Comments

  • zibadianzibadian Member Posts: 6,349
    : Hi all,
    : As you will see, I'm pretty new to this stuff.
    : I need to allow end user to input a bunch of parameters, both numeric and string, for a large number of similar objects. The easiest way I can see to present this is with a TStringGrid that the user simply fills in. How do I do the following:
    :
    : 1: Detect if the user has moved from one cell to another? I would use this to validate the data that was entered.
    :
    : 2: Set the data type to integer, real or string on a column basis.
    :
    : Any help will be appreciated
    :
    : Thanks
    :
    : Brendon
    :
    :
    : Brendon Parise
    : Wannabee software writer
    :
    You need the OnSelectCell() Event. The TStringGrid.Row & Col properties hold the current cell indexes. The parameters hold the new cell indexes.
    To set the data on a column base, I suggest that you create an additional integer array, which is as big as the number of columns. This array stores the "type" of the column. Now you can use a case-of statement to perform the type-checking and the appropriate StrToXXX() function to change the type.
Sign In or Register to comment.