locked
custom control hosting in DataGridView Header RRS feed

  • Question

  • Is there a way to host a custom control inside a DataGridView Header? I'm specificly trying to host a ComboBox control inside the Column Header cell. Is this possible? If so, how?
    Saturday, January 28, 2006 11:15 PM

Answers

  • No, header controls do not support control hosting. The best you can do is either a) position outside the DGV or b) manually position them inside the DGV attempting to align up the combobox.

     

    Check out this sample created by a member of the VB team that supports in-place renaming of column headers using a text box for an idea on control placement: http://www.windowsforms.net/blogs/markrideout/Rename-In place Column Headers.zip

     

    -mark

    DataGridView Program Manager

    Microsoft

    This post is provided "as-is"

     

     

    Sunday, January 29, 2006 3:09 AM

All replies

  • No, header controls do not support control hosting. The best you can do is either a) position outside the DGV or b) manually position them inside the DGV attempting to align up the combobox.

     

    Check out this sample created by a member of the VB team that supports in-place renaming of column headers using a text box for an idea on control placement: http://www.windowsforms.net/blogs/markrideout/Rename-In place Column Headers.zip

     

    -mark

    DataGridView Program Manager

    Microsoft

    This post is provided "as-is"

     

     

    Sunday, January 29, 2006 3:09 AM
  • I have made something like that for filtering funtionality.  Sendme an email to hfmm99@hotmail.com to send you the code.
    Friday, January 26, 2007 4:21 AM