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.

How to reduce time loading grid? (1.6.1)

Thread ID:





17307 Aug 5,2004 10:40 AM Aug 5,2004 11:36 AM Windows Forms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On August 5, 2004 10:40 AM

So I have a grid that contains calculated values for each month of about 160 rows. Below is an example of how I populate the grid. Currently it takes approximately 10 seconds to populate the grid. Are there any techniques that I could employ to speed this process up? Thanks, s.s. BeginUpdate() Dim value as Decimal Dim gsi As GridStyleInfo = New GridStyleInfo() For Each = deptID In DeptList For Each DeptItemID In DeptItems For month = 1 To 12 '' get values from local DataTable, '' peform calculations, '' and return the result gsi.CellValue = CalculateNewValue(DeptID, DeptItemID, month) GridControl1.SetCellInfo(row, col, gsi, Syncfusion.Styles.StyleModifyType.Changes) Next Next Next EndUpdate()

Administrator [Syncfusion]
Replied On August 5, 2004 11:00 AM

Try code like this. It works directly with the GridData object and avoids events. (I did this without syntax checking so I may have mistyped something).
Dim data As GridData = GridControl1.Data

For month = 1 To 12
'''' get values from local DataTable,
'''' peform calculations,
'''' and return the result
Dim style as GridStyleInfo
If Not data(row, col) is Nothing Then
	style = new GridStyleInfo(data(row, col))
	style = new GridStyleInfo()
style.CellValue = CalculateNewValue(DeptID, DeptItemID, month)

data(row, col) = style.Store

Administrator [Syncfusion]
Replied On August 5, 2004 11:36 AM

Thanks, Clay. That cut the time in half. I suspect the rest of the time is spent performing the actual calculations. Guess I''ll have to fix that on my own! s.s.


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.