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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

code optimisation

Thread ID:

Created:

Platform:

Replies:

60046 Apr 26,2007 05:01 PM UTC WinForms 0
loading
Tags: GridControl
dinesh upreti
Asked On April 26, 2007 05:01 PM UTC

hi,

My application require the following piece of code to be executed to acheive the desired functionality.
The average value for dgRangePlanGrid.TableDescriptor.Columns.Count is 300 and its taking around 8 seconds to execute this code..
Can you help me in optimising this code.
One more thing is that in my out put window, when i debug the application, i get the following message.

"Could not find Field with name in EntityCollectionView`1 for column Column 1". Can that be the reason for the long time taken. If yes, waht can be the resolution.



for (int i = 0; i < dgRangePlanGrid.TableDescriptor.Columns.Count; i++)
{
viewColumnName = dgRangePlanGrid.TableDescriptor.Columns[i].Name;

if (!dgRangePlanGrid.TableDescriptor.VisibleColumns.Contains(viewColumnName))
{
dgRangePlanGrid.TableDescriptor.VisibleColumns.Add(viewColumnName);
dgRangePlanGrid.TableDescriptor.Relations[Constants.SUPPLIERFACTORY_RELATION].ChildTableDescriptor.VisibleColumns.Add(viewColumnName);

if (viewColumnName == "StatusCancelled")
{
dgRangePlanGrid.TableDescriptor.Columns[viewColumnName].Width = 50;
dgRangePlanGrid.TableDescriptor.Relations[Constants.SUPPLIERFACTORY_RELATION].ChildTableDescriptor.Columns[viewColumnName].Width = 50;
}
else
{
dgRangePlanGrid.TableDescriptor.Columns[viewColumnName].Width = 0;
dgRangePlanGrid.TableDescriptor.Relations[Constants.SUPPLIERFACTORY_RELATION].ChildTableDescriptor.Columns[viewColumnName].Width = 0;
}
}
}

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.

Warning Icon 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.Close Icon

;