Visual Basic Development Bookmark and Share   
 Home > Visual Basic Language > DATAGRIDVIEW BLINKING
 

DATAGRIDVIEW BLINKING

DataGridView1.Rows(e.RowIndex).Cells("DIFFERENT").Value = DateDiff(DateInterval.Year, DataGridView1.Rows(e.RowIndex).Cells("YEAR1").Value, DataGridView1.Rows(e.RowIndex).Cells("YEAR2").Value)
THIS code i put in datagridview_cellformating............

when i click button add (dt.rows.add(textbox))....all row in datagridview blinking and if too many rowswas added ,the blinking increase faster..


somebody help me please....................
  • Changed Typemipakteh Tuesday, December 01, 2009 2:37 AMno answer
  •  
mipakteh  Monday, November 30, 2009 4:20 PM
You are resetting that value every time the cell refreshes; which is not necessary. The value should only be set when one of the other dependant values changes.

If the datagridview is bound then you should be changing the underlying datasource anyway, rather than setting the cell value direclty. It looks like you could probably use an expression column to handle this since it appears to be a simple date calcuation...
Reed Kimble - "When you do things right, people won't be sure you've done anything at all"
Reed Kimble  Monday, November 30, 2009 4:35 PM
yes...reed kimble you correct
it about the date calculation
        DataGridView1.Rows(e.RowIndex).Cells("different").Value = DateDiff(DateInterval.Year, DataGridView1.Rows(e.RowIndex).Cells("year1").Value, DataGridView1.Rows(e.RowIndex).Cells("year2").Value)

can you give me some code for example??

thank...

mipakteh  Monday, November 30, 2009 4:54 PM
sorry reed kimble..i don't mention you..i using DATEDIFF in datagridview_cellformating
mipakteh  Monday, November 30, 2009 5:10 PM

You can use google to search for other answers

Custom Search

More Threads

• Stupid problem understanding variable reference problem
• Word color
• Close Form Problem
• Application.DoEvents() in a Windows Service? + Other Questions
• The value violates the MaxLength limit of this column
• VB.Net application is slow
• Displaying images in datagrid columns
• GetChange problem
• Windows Service OnStart event
• Windows2000 "printto" verb problem: Not printing on Network printer