DataGridView Button

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

I need to add a button to a DataGridView, but the button should only show up in the cell when user clicks on a cell in the DataGridView and disapear when user clicks off the cell.

Does anyone know how to do that or has an example?


Thank you



Peter
 
Hi Peter,

Thanks for your post.

First, we should implement a customized Button control which implements the
IDataGridViewEditingControl interface, then implement a customized
DataGridViewTextBoxCell which returns the customized button control in its
EditType property.

The link below provided a sample, which implemented a customized
DateTimePicker control column:
"How to: Host Controls in Windows Forms DataGridView Cells "
http://msdn2.microsoft.com/en-us/library/7tas5c80.aspx

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top