Home - Forums-.NET - FlyGrid.Net (Windows Forms) - Flygrid slows...

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

Flygrid slows...
Link Posted: 10-Dec-2005 06:48
I have a flyGrid which has 32 columns with a combination of dropdown, memo and text columns. The grid is not databound, so at the moment all I am adding is blank rows. The problem that I have is that the performance of the grid is quite bad, with regards to using the scrollbar, I would move the scrollbar either by dragging it or using the mouse wheel, but the grid will then suddenly jump to a point rather than smoothly scrolling.

Also if you grab the horizontal scrollbar and slide it to a point (half way for example) the app. will freeze. I have attached an example to show.

Have you found this to be an issue??? Is there a solution??? Am I doing something wrong??

Thanks

Simon
Link Posted: 11-Dec-2005 19:10
if you partially fill node data:
[VB]
Dim data As Object() = New Object() {"Column " & i.ToString}
Me.FlyGrid.Rows.Items.Add(New Node(data))


FlyGrid fill unfilled data, and restructure Node.Value with missing values, it is slow operation, as FlyGrid need to analyze Node.Value and if node.Value is array - redimension this array.

More correct, fast and optimal way to fill grid in your sample, looks as following:
[VB]
Private Sub btnAddRow_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddRow.Click
    Dim i As Integer
    Me.FlyGrid.BeginInit()
    For i = 0 To 2000
    Me.txtStatus.Text = "Loading rows " & i.ToString & " of 2000,please wait..."
      Me.txtStatus.Refresh()
      Dim data As Object() = New Object(Me.FlyGrid.Columns.Items.Count) {}
      data(0) = "Column " & i.ToString
      Me.FlyGrid.Rows.Items.Add(New Node(data))
    Next i
    Me.FlyGrid.EndInit()
    Me.txtStatus.Text = ""
End Sub


PS: If you add a huge amount of data or make massive change in the FlyGrid, use FlyGrid.BeginInit/EndInit pair to freeze/unfreeze FlyGrid refreshing events, this increases performance of FlyGrid initialization.
Link Posted: 12-Dec-2005 11:42
Thank you that fixed it.

Simon