none
Redraw Button width in Button Column in DataGridView RRS feed

  • Question

  • I need to redraw a button in a button column in a DataGridView.  Nothing to complicated other than I do not want the width to be as wide as the column width.  To do so I am assuming that I have to create a custom button column object which inherits from the ButtonColum.  Then I am assuming that I have to over-ride the Draw of the buttton itself.

    Can anyone provide with a start on this?

    Thanks

    EM
    Monday, August 10, 2009 2:13 PM

Answers

  • One option may be to look at the CellStyle for the column (DefaultCellStyle I think) there is a "padding" property. I will circle back on this and confirm.

    Thanks

    EM
    • Marked as answer by ExcelMonkey Thursday, September 3, 2009 2:56 PM
    Tuesday, August 11, 2009 2:28 PM

All replies

  • One option may be to look at the CellStyle for the column (DefaultCellStyle I think) there is a "padding" property. I will circle back on this and confirm.

    Thanks

    EM
    • Marked as answer by ExcelMonkey Thursday, September 3, 2009 2:56 PM
    Tuesday, August 11, 2009 2:28 PM
  • Yes the padding worked fine.

    THanks
    Thursday, September 3, 2009 2:56 PM