Datagridview cell values disappearing

Posted on 2006-12-01
Last Modified: 2008-02-01

I have 2 datagridviews (dg1 & dg2) bound to a dataset and when they are filled one cell in dg2 is empty.
If I click on another cell in dg2 then that cell is selected and the previously empty cell value appears.
But if I then click a cell in dg1 the clicked and selected cell in dg2 becomes empty.

All help appreciated.
Question by:alungwyther
  • 4
  • 2

Accepted Solution

rockas1982 earned 500 total points
ID: 18059214
you have to change the colors
when you focus a cell it take difrent color and probably you have set it to white so white strings with white backround  =empty byt the string is there

Author Comment

ID: 18059220

Thanks for the reply.The cell that has the focus shows the value OK, it is the cell that has lost the focus that appears empty even though there is a value in it.


Expert Comment

ID: 18059245
there is an option for that 2
color for the cell that is focus color for the cell that lost the focus i don't know where exactly cause i use another componet but there must be
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.


Author Comment

ID: 18059573
Hi rockas1982

The cell that has lost focus is white with no value in it.
If I click on another cell in the same grid it stays white but the value appears.

LVL 10

Expert Comment

ID: 18059615
are you assigning the values dg1.item(1,1).value="5"
if you are try using dg1.item(1,1).editedformattedvalue="5"

Author Comment

ID: 18059663
Hi gangwisch

The grids are bound to a datatable so the values are not manually assigned.

Author Comment

ID: 18122762
Hi rockas1982

Apologies, I didn't read your reply properly or look into it enough but you were right.


Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question