none
Display a Label when Data Grid Column is not selected and a Combo Box when Selected RRS feed

  • Question

  • Is it possible to display a label text in a cell when the row of the data grid is not selected and to display a combo box in the same cell when the row is selected?

    I have been looking at the implementations for DataGridViewComboBox but it will display a Combo Box all the time. I just want to display a label when the row is not selected.

    Any ideas or suggestions would be helpful.

    Friday, August 16, 2019 11:56 AM

All replies

  • Hi,

    One workaround is to create a custom usercontrol and host it in datagridview. For more info, you can refer to the document How to: Host Controls in Windows Forms DataGridView Cells.

    Regards,

    Kyle


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 21, 2019 7:53 AM
    Moderator