This is a migrated thread and some comments may be shown as answers.

Gridview freezing UI

1 Answer 218 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Spiffy Jones
Top achievements
Rank 1
Spiffy Jones asked on 09 Jul 2013, 04:20 PM
I'm using a radgridview to display search results for metadata for files. The grid has 6 columns and for any search I try, whenever I'm adding results to the grid, the whole UI is freezing until the results are added.

I've tried it with a background worker and adding the rows in the report progress event., but it still doing this.

The grid is placed on a tabpage control.

1 Answer, 1 is accepted

Sort by
0
Anton
Telerik team
answered on 11 Jul 2013, 08:49 AM
Hello Spiffy,

Thank you for writing.

The issue in your case appears due missing BeginUpdate and EndUpdate methods around your logic that inserts the rows into RadGridView. With this methods RadGridView suspends the updates after  each addition and performs them only once, whwn EndUpdate is called. Consider the following example:
radgridMetadata.BeginUpdate()
For inti = 0 To UBound(objRow)
    Dim rowInfo As New Telerik.WinControls.UI.GridViewDataRowInfo(Me.radgridMetadata.MasterView)
    rowInfo.Cells("colDocumentID").Value = objRow(inti).Item("Document_ID").ToString
    rowInfo.Tag = objRow(inti).Item("docType")
 
    If objRow(inti).Item("document_date").ToString <> "" Then
        rowInfo.Cells("colDateDocument").Value = CDate(objRow(inti).Item("Date_Document").ToString).ToShortDateString
    End If
    rowInfo.Cells("colTitle").Value = objRow(inti).Item("title").ToString
    rowInfo.Cells("colDocumentType").Value = objRow(inti).Item("document_type").ToString
    rowInfo.Cells("colHostReference").Value = objRow(inti).Item("host_reference").ToString
    rowInfo.Cells("colDescription").Value = objRow(inti).Item("description").ToString
 
    radgridMetadata.Rows.Add(rowInfo)
Next
radgridMetadata.EndUpdate()

I hope this helps.

Regards,
Anton
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Spiffy Jones
Top achievements
Rank 1
Answers by
Anton
Telerik team
Share this question
or