473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Custom DataGridViewColumn and Databinding

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
May 10 '07 #1
1 3501
Are CellFormatting/CellParsing events not good enough to set output value on
the cell in question?

Alex

"Charles Bazi" <cb***@noos.frwrote in message
news:eR**************@TK2MSFTNGP02.phx.gbl...
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

May 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: tsair | last post by:
When i add a new property into datagridviewcolumn, the property alway show null even i has been key in something in the property. how to solve this ? thank you
0
by: Tsair | last post by:
I create a custom DataGridViewColumn from a usercontrol with Textbox and a button. After input the usercontrol textbox value and press Tab to next column, the value of the textbox does not show in...
2
by: Andy | last post by:
Hi all, I'm creating my own DataGridViewColumn class, and have added a string property to it which should be settable via the Property designer. I've gotten the property to show up, but even if...
1
by: John J. Hughes II | last post by:
I am trying to create a custom DataGridViewCell which is "NOT" derived from DataGridViewTextBoxColumn. The painting works fine but I am unable to get the control into edit mode. Do I need to...
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
0
by: Franz | last post by:
I created a custom dataGridViewColumn which only accept numbers. For this Column, I can define a precision (number of decimal). I can set this property into my code, but not in design mode! ...
1
by: Mark Olbert | last post by:
Has anyone else noticed that the design-time support for databinding in custom controls in ASPNET2 sucks? At least for GridViews? So far I've spent going on two days trying to get the following...
1
by: kumag | last post by:
I'm using this column type binded to a datasource column. I would like to use a string collection in another column of the same data source. is this possible? is there like a...
1
by: lbelkova | last post by:
Hello, I've created a custom DataGridViewColumn. Everything work well, except for some reason the column doesn't accept some of the chars: "q", "." and "'". Did anybody have a similar problem?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.