We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Optimizing render speed when applying style changes to elements

When changing the class of an element in order to change its css display style, what is the best way to ensure good performance. Example 1: htmlUiControl.SuspendLayout(); element.Attributes["class"].Value = cssClassName; htmluiControlMain.PerformLayout(); Example 2: htmlUiControl.BeginUpdate(); element.Attributes["class"].Value = cssClassName; htmluiControlMain.EndUpdate(); If neither of these sequences are correct, do you recommend another method?

2 Replies

DJ Davis Jebaraj Syncfusion Team February 1, 2005 01:02 PM UTC

Hi, If you are making multiple attribute changes, you can call the BeginUpdate / EndUpdate methods. The HTMLUIControl will not update its interface till the EndUpdate method is called. Regards, Davis


DJ Davis Jebaraj Syncfusion Team February 4, 2005 04:50 PM UTC

Hi Adam, I just realized that you can optimize the style changes by setting the htmluiControl1.Document.BeginUpdate(); and htmluiControl1.Document.EndUpdate(); We can change the behavior so that the BeginUpdate and EndUpdate methods of the HTMLUIControl also have the same effect. Thanks, Davis

Loader.
Up arrow icon