General discussion

  • Creator
  • #2279333

    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 ?

All Comments

  • Author
    • #3365024

      Reply To: Text box in a flexgrid area

      by madestroitsolutions ·

      In reply to Text box in a flexgrid area

      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 and I will be more than happy to give you sample code.

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

    • #3365443

      Reply To: Text box in a flexgrid area

      by d_gilmour_1978 ·

      In reply to Text box in a flexgrid area

      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

    • #2683750

      Reply To: Text box in a flexgrid area

      by ytvsoftware ·

      In reply to Text box in a flexgrid area

      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.

Viewing 2 reply threads