briddums
briddums

Reputation: 1846

Infragistics - disable ultrawingrid automatically updating when datasource changes

I have a wingrid that is bound to a datatable. I create a new asynchronous thread and from that thread make a remote server call passing the datatable. When the server call is completed the wingrid automatically refreshes to show any changes. However, since this is not being done on the main UI thread of the program, we will often get an error where the control goes whilte and a big red X appears in it.

Is there a flag to set the wingrid to not automatically upate when the datasource changes? I would like to turn it off before the remote server call and turn it on again after I am back on the main thread.

Upvotes: 2

Views: 3203

Answers (2)

briddums
briddums

Reputation: 1846

The solution was to use

Grid1.BeginUpdate()

before the asynchronous method. This methods prevents the grid from painting. Then use

Grid1.EndUpdate()

on the UI thread once the asynchronous method was done.

Upvotes: 2

competent_tech
competent_tech

Reputation: 44941

I think what you want is:

Grid1.SuspendRowSynchronization()

then, when done:

Grid1.ResumeRowSynchronization()

Upvotes: 0

Related Questions