We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Strange drawing in grid.

Thread ID:

Created:

Updated:

Platform:

Replies:

16302 Jul 12,2004 06:07 AM Jul 12,2004 09:06 AM Windows Forms 1
loading
Tags: GridControl
Andrey Plinda
Asked On July 12, 2004 06:07 AM

Hello! I have created sample, where occurs such problem. Sometimes after resizing grid columns or after sometime appear unwanted cells on unexisted columns (See StrangeDraw.zip). Where can be a problem? Best regards! RedrawGrid_7370.zip StrangeDraw_9866.zip

Administrator [Syncfusion]
Replied On July 12, 2004 09:06 AM

You can only access the grid (or any other Windows Forms control) on the thread that created it. The m_OnUpdate handler is being called from nonUI threads, so you have to recall it on the UI thread that created the grid.
private void m_OnUpdate(Manager m)
{
	Int32 row = m_Managers.IndexOf(m) + 1;
	if(this.gridControl1.InvokeRequired)
	{
		Console.WriteLine("InvokeRequired");
		this.gridControl1.BeginInvoke(new OnUpdateDelegate(m_OnUpdate), new object[]{m});
		return;
	}
	gridControl1.RefreshRange(GridRangeInfo.Cells(row, 1, row, 5));
}

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;