Custom DataGridViewColumn and Databinding

C

Charles Bazi

Hi,

Based on MSDN http://msdn2.microsoft.com/en-us/library/7tas5c80.aspx
smple, I have made my custom DataGridViewColumn.

I use it to host a custom control, sort of ComboBox, but instead of
having a dropdown list, it opens a search dialog when the button of
control (a textbox with a button) is pressed.

So, when I pick something with my control, I have two results in my
control: a GUID and a text for the GUID 'explanation'.

I override Paint event in my DataGridViewTextBoxCell and I put the GUID
value on object'value' parameter and the text 'explanation' of the GUID
in object formattedValue parameter.

It works well, but when I edit another cell of the same row, or even a
textbox in the form hosting the DataGridView, the cell of my custom cell
becomes blank...

I guess it have something to do with DataBinding refresh, but I really
don't know how to handle it ?

Thank you
 
A

AlexS

Are CellFormatting/CellParsing events not good enough to set output value on
the cell in question?

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top