Solved

Unbound Datagridviewcell value does not  or refresh immediately

Posted on 2009-07-13
3
699 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:wrwilson
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 20

Accepted Solution

by:
alainbryden earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SlingPlayer alternatives 1 35
What .NET URL re-routing tool did I use? 2 37
ASP.NET 5 Templates 2 66
Help with AsEnumerable(), LINQ 4 22
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now