Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Unbound Datagridviewcell value does not  or refresh immediately

Posted on 2009-07-13
3
Medium Priority
?
710 Views
Last Modified: 2012-05-07
Hi,
I  have an unbound datagridview cell column.The cell value is changed by clicking on contextmenu.The problem is that it does not refresh immediately I need to click outside the cell to actually see  the change.
Any suggestions on refreshing it immediately.

Cheers
0
Comment
Question by:RIAS
3 Comments
 
LVL 7

Expert Comment

by:Randy Wilson
ID: 24839037
Attach some code please...
0
 

Author Comment

by:RIAS
ID: 24839202
 Private Sub ContextMenuStrip1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ContextMenuStrip1.MouseClick
        FlgContextmenuClicked = True
        Datagridview2(ColumnCoordinate, RowCoordinate).Value = "No"
    End Sub

Cheers
 
0
 
LVL 21

Accepted Solution

by:
alainbryden earned 2000 total points
ID: 24849263
After you change the value, try using
DataGridView.InvalidateCell(ColumnCoordinate, RowCoordinate)

This should force the cell to be repainted (and thus the value change to be made apparent)

--
Alain
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
Simple Linear Regression
Introduction to Processes

773 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