Home Forums WinForms controls Xceed Grid for WinForms Detecting if BeginInit has been called Reply To: Detecting if BeginInit has been called

User (Old forums)
Member
Post count: 23064

There is no problem in calling EndInit() without having called BeginInit() previously.  If you want to make sure it is always called, you can simply do it in a try finally block.

e.g.:

gridControl1.BeginInit()
try
{
   // code
}
finally
{
   gridControl1.EndInit();
}

Note that you can always verify the InBatchInitialization property on GridControl to know if the grid is in a batch update (thus BeginInit() has been called).  You will not see it in code completion because its Browsable attribute is set to false.

 

Imported from legacy forums. Posted by André (had 268 views)