Board index » cppbuilder » TStringGrid Editing with a TEdit

TStringGrid Editing with a TEdit

I want to pop up a TEdit over a selected cell for editing - I have used
OnSelectedCell to get the cell and set the Edit component visible and set
the Top and Left but the TEdit doesn't appear.  Is it a conflict between
TStringGrid editing ?  I use the same code for a ComboBox and it works
fine.  Any suggestions?
--
JTT
 

Re:TStringGrid Editing with a TEdit


TStringGrid already has its own built-in editor for exactly that.  You don't
need to use a separate TEdit for it.  Just set the grid's EditorMode
property to true when needed (the Options property needs to include the
goEditing value).

Gambit

Quote
"jtt" <st...@nojunk.tabermatics.com> wrote in message

news:3dc01bed@newsgroups.borland.com...
Quote
> I want to pop up a TEdit over a selected cell for editing -

Re:TStringGrid Editing with a TEdit


Quote
Remy Lebeau (TeamB) wrote:
> TStringGrid already has its own built-in editor for exactly that.  You
> don't
> need to use a separate TEdit for it.  Just set the grid's EditorMode
> property to true when needed (the Options property needs to include the
> goEditing value).

Had lots of trouble trying to implement this - decided a TEdit was much
simpler - Took a while to solve it - had to set the TEdit -> Parent to the
StringGrid - now working okay   -

--
JTT

Re:TStringGrid Editing with a TEdit


Quote
"jtt" <st...@nojunk.tabermatics.com> wrote in message

news:3dc0a314@newsgroups.borland.com...

Quote
> Had lots of trouble trying to implement this

Can you be more specific?

Quote
> decided a TEdit was much simpler

The built-in editor is already a TCustomEdit decendant.

Gambit

Re:TStringGrid Editing with a TEdit


The goEditing option must be set to true in order to use EditorMode.

Gambit

Quote
"jtt" <st...@nojunk.tabermatics.com> wrote in message

news:3dc16d86@newsgroups.borland.com...
Quote
> I was setting EditorMode = true when I wanted to edit but
> it seemed to have no effect.  Maybe it had to do with
> goEditing - I couldn't figure out whether that was supposed
> to be set to true or false

Re:TStringGrid Editing with a TEdit


Quote
Remy Lebeau (TeamB) wrote:
>> Had lots of trouble trying to implement this

> Can you be more specific?

Well it had to do with the settings and the documentation - I was setting
EditorMode = true when I wanted to edit but it seemed to have no effect.  
Maybe it had to do with goEditing - I couldn't figure out whether that was
supposed to be set to true or false as well as another property which I
forget right now.  Documentation lacks any good examples.  Anyway my TEdit
is working just fine now that I made the parent = stringGrid.
--
JTT

Other Threads