Home Forums WinForms controls Xceed Grid for WinForms BeginInit and EndInit : when to use?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13849 |

    Could someone please explain when are the proper times to use BeginInit and EndInit on Xceed.Grid (and other Xceed components in general). I appreciate it. I just don’t want to put them in my code all the time unless they’re really necessary, you know? Thanks.

    Imported from legacy forums. Posted by oakfish (had 3490 views)

    User (Old forums)
    Member
    Post count: 23064

    I use it when I need to change different things that influence the content of the GridControl, and that might cause sorting, painting or rebuilding of the GridControl’s DataRows.
    Example: when I have a GridControl that is bound to a DataTable or DataView, I call BeginInit before and EndInit after updating the content of the DataTable. When a GridControl is bound to a DataView, and the filter of the DataView has to change, I also put it between BeginInit and EndInit, because it causes the GridControl to rebuild its DataRows.

    Imported from legacy forums. Posted by Tommy (had 388 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks, Tommy. Good to know.

    Imported from legacy forums. Posted by oakfish (had 382 views)

    Odi [Xceed]
    Spectator
    Post count: 426

    Xceed grid provides the BeginInit and EndInit functions to allow the developer to set many properties freely without causing those properties to trigger any required update code over and over. Only upon the EndInit would the update code be executed. So, this mechanism allows you to sometimes gain speed advantages, reduce unecessary screen updates, reduce database updates, etc.

    Imported from legacy forums. Posted by Odi [Xceed] (had 4596 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.