468,133 Members | 1,486 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

DataGridView Button

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

Dec 2 '05 #1
3 14527
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.

Dec 2 '05 #2
Thank you very much !!!!


""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:j3**************@TK2MSFTNGXA02.phx.gbl...
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.

Dec 2 '05 #3
You are welcome

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.

Dec 2 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mark Carew | last post: by
6 posts views Thread by Miro | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.