General discussion

Locked

Text box in a flexgrid area

By ASHWINJ21 ·
how to use a textbox in a flexgrid area and enter the value in flexgrid through textbox ?

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by MadestroITSolutions In reply to Text box in a flexgrid ar ...

There is no way to do that. What you do instead (and this is a known hack) is that you get the coordinates of the cell you are attempting to edit, and position a textbox or combo box on top of it, which receives the focus and allows the user to edit the content. Once they finish editing, you programmatically update the value and refresh the grid.

Unfortunately, the code will not fit in here, so e-mail me at juanja01@optonline.net and I will be more than happy to give you sample code.

Good Luck!, and DONT FORGET to rate my answer >:)

Collapse -

by D_Gilmour_1978 In reply to Text box in a flexgrid ar ...

You need to position a text box over the top of the cell and then programatically update the grid behind the text box. If you want fancy stuff like being able to resize the grid and have the text box reposition itself etc then you will need to do some API calls and some sub classing (All good fun really). There are articles available from microsoft with sample code which works reasonably well

Collapse -

by ytvsoftware In reply to Text box in a flexgrid ar ...

I use other technics then was described above. The method is more flexible and reliable and more easy to program. Create a modeless dialog with edit control or any things you prefer and make it child of your grid or other window or no parent at all depending on you needs. The main is use options making it system modal so it will keep focus. For moving and resizing the dialog and the edit control use SetWindowPosition.
The data entered in the edit box or other can be processed inside dialog or/and post/send by message in your application. Notify the dialog by messages or control directly about the changes related to the Grid. At some cases you can make modal dialog depending on your requirements toward data processing. Also it not always is nessasary to make edit control and dialog transparent. Sure it can be combined with
making it invisible etc. If you develop such way you find numerous reuses of such dialog. I personaly developed a set of flags for controling
of dialog for various purposes.
At some situations it can be combined with using of hooks. If it is important for you I can provide consulting.

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums