• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 880
  • Last Modified:

Datagridview cell values disappearing

Hi

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.
Regards
0
alungwyther
Asked:
alungwyther
  • 4
  • 2
1 Solution
 
rockas1982Commented:
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
0
 
alungwytherAuthor Commented:
Hi

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.

0
 
rockas1982Commented:
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
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
alungwytherAuthor Commented:
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.

0
 
gangwischCommented:
are you assigning the values dg1.item(1,1).value="5"
if you are try using dg1.item(1,1).editedformattedvalue="5"
0
 
alungwytherAuthor Commented:
Hi gangwisch

The grids are bound to a datatable so the values are not manually assigned.
0
 
alungwytherAuthor Commented:
Hi rockas1982

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

Alun
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now