How to enter edit status after poping a messagebox

Posted by: malishin on 4 July 2021, 8:49 pm EST

    • Post Options:
    • Link

    Posted 4 July 2021, 8:49 pm EST

    My requirement is to enter the content in the cell. When I press Enter, the input content is verified first. If it does not match, Msgbox will pop up a message, and then let the current cell continue to be edited.

    Now after Msgbox pops up the message, the cell cannot remain edited.

  • Posted 21 September 2021, 7:42 am EST

    Hello Malishin.

    Based on your sample, it appears that your trying to use the ActiveX vsFlexGrid in a VB .NET application. While you can use ActiveX controls in .NET, it is accomplished via an Interop layer that Visual Studio creates. Basically a little “bubble” of ActiveX that the control exists within and all interactions with the control need to be translated between the different platforms. For this reason, we don’t support our ActiveX controls in a .NET project (we don’t control the Interop layer, it’s provided by Microsoft). Rather, we suggest you use our .NET controls if your developing a .NET project.

    For Winforms, we have the C1FlexGrid, which is a .NET version of the FlexGrid control that will be much better suited for your application. Note, it is not just the vsFlexGrid control converted to .NET but a completely rewrite that takes advantage of all the .NET features and functionalities.

    Below is a link to the documentation with information about how to setup Validation which might be good fit for what your trying to do.

    I hope that helps. If you have any questions, please let us know.

    Thank you.


  • Posted 21 September 2021, 8:11 am EST

    FYI, I did figure out a way to get your code to work. If you repeat the axVSFlexGrid1.EditCell() call twice inside your If your statement, it will display the MessageBox and then return to the same cell in edit mode when you close the MessageBox dialog.

    I think this may be an interop issue as your leaving the control to execute the .NET MessageBox but the vsFlexGrid still thinks it’s in edit mode, so when you call the first EditCell() it’s actually taking it out of edit mode. By calling it again, it starts edit mode again.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels