User Profile & Activity

Shawn August Member
Page
of 19
Posted: February 10, 2011 12:40 AM

Hello Shawn,

Basen on another thread, I already explained about the issue. Perhaps, my previous explanation wasn't good enough.
This performance issue is caused by WebToolBar or WebMenuBar and only shows at IE.
WebToolBar or WebMenuBar use AddStyle() method to customize theirstyle. Somehow, AddStyle() method is not functioning in IE (browser limitation).
In order to avoid this issue, we suggest to customize the style with CSS, include the standard style.
When using standard style, AddStyle() method would be automatically activated to retrieve/set the standard style.

E.g 
Your current simple sample.

I applied the CSS into WebToolBar and the performance works well.

Regards,
Handy


 

Can you explain further? I briefly checked your modified page and it seems like you only added CSS to fix the bug? I don't understand why I would have to add CSS to fix the performance? Also, I don't understand why it works perfectly fine if a splitbutton/dropdown button with a child exists? As soon as I remove that, the performance is back. I also don't understand how AutoFitColumns fixes this problem?

Please explain? Also, is that the only CSS that must be used to avoid this performance bug? Again, I am still unsure why CSS must be used? And, if it is necessary what are the options to avoid this performance bug?

 

When I get in the office in the morning, I will apply the CSS (Is the WebToolBar's CSS the only change? We have other WebToolBars in our application, should the same CSS be applied there too?) to the WebToolBar.

 

Thank you.

I have attached a solution with the bug reproduced. I added a CHECKBOX control to the page to turn the bug on/off as well as a BUTTON to refresh the page.  This bug is really odd.  I am not sure how this is all connected but adding a SplitButton/DropDownButton to the ToolBar dramatically hurts performance to the point that we cannot use ANY of our applications. Furthermore, I am not sure why changing the WebToolBar's IntegrateTo and WebGrid's AutoFitColumns properties bring the performance back as expected? 

Please let me know as this is extremely high priority. Thank you!

Hello,

Would you mind to provide us a simple runable sample which can show us the issue? We need to see the comparasion result with previous version. 

http://www.intersoftpt.com/Community/WebGrid/WebGrid-7---Render-Performance-Extremely-Slow-When-WebMenuBar-On-Page/
This customer has confirmed that the workaround resolve performance issue. So, if you said the issue has surfaced, we need more details to help you fix this issue.

Regards,
Handy


Yea, that thread is nearly a year ago but I wanted to point out that another person had the issue too.

I will make you a reproducible example as soon as I get in the office tomorrow morning 9ish EST. Can you reproduce the bug given the same example you gave me in this thread? We used that code that moves the CSS to an external CSS file to fix the problem last year.

 

Thanks for the fast reply.

 

This problem has resurfaced! The previous fix for us was to put the WebToolBar's CSS within a CSS file as suggested within this thread which fixed the problem. However, after upgrading to the current version of Intersoft, the performance bug is back and it's system wide across multiple applications. Here's another user with a similiar issue: 

http://www.intersoftpt.com/Community/WebGrid/WebGrid-7---Render-Performance-Extremely-Slow-When-WebMenuBar-On-Page/


The bug still exists even after removing *ALL* of the CSS (for testing) so I am not sure what's causing the problem. However, the performance is back if you:


1) Remove WebToolBar's IntegratedTo property which was set to "NONE"

     This causes the WebToolBar to have multiple JavaScript exceptions (this.CommandStyle is null or not an object) and the UI to be skewed

2) Set the WebGrid's AutoFitColumns to TRUE

    This is not desireable as we want to specify the column widths.


Please help as this is a major production issue making ALL of our applications unusable.


Thank you!

Thank you for the additional information.

I will have this information forwarded to the dev team and will let you know any news I heard from the team regarding this.

 

I found another bug that appears to be releated.  This only occurs for the "NewRow", at least one column is frozen, and if you use the horizontal scrollbar to scroll a field out of view. Then, if you handle the WebGrid's AfterExitMode, the field within the EditObject isn't the correct field being edited.

This issue is actually not WebGrid’s issue. It is caused by the rendering engine that belongs to the browser itself. Render a table that has thousands of rows is not that easy for web application. Not only WebGrid, but I believe event an HTML table itself.

You could improve WebGrid’s performance by disable WebGrid’s data caching, set PagingMode to Virtual Load and set WebGrid’s ViewStateStorage to none. Another option that you may try is probably the load on demand data retrieval concept. Child rows data of its parent row will not be rendered to client on each loaded table. The child rows of a table will be retrieved transparently when users click on “+” sign to expand the child rows. This results in efficient information delivery by displaying necessary information and load more information transparently when needed, all without leaving the current state of the working page.

Hope this helps.

 

Did you even read my thread? First of all, the VirtualLoad is MUCH slower by over ~45 seconds vs ClassicPaging. Furthermore, the ViewStateStorage is set to None per the markup I posted. Can you elaborate on how to disable the Data Caching?

In regards to your comment about this not being a WebGrid issue but a browser issue. I strongly disagree. It should not take nearly 2 minutes to load 3,500 records w/ a 200 page size. There is a tremendous difference in performance just changing from VirtualLoad to ClassicPaging and from changing the page size from 200 to 50.  Why would changing the page size from 200 to 50 result in over a ~46 second difference using ClassicPaging? Why does the rendering differ soo much between these settings? I work with other 3rd party controls such as Telerik, Infragistics, and even the base ASP DataGrid and *NONE* of them take nearly 2 minutes to load only 3,500 records w/ a page size of ~200 so I am not sure what those competitor products are are doing different. 

Posted: January 13, 2011 9:48 AM

Hello,

Please read my previous post. Please ensure that you use the latest hotfixes. You can see in my attachment video. All the fields show alert in format dd-MMM-yyyy. There are nothing wrong with the sample when I ran it unless I am missing something. 

Regards,
Handy

 

It must be an issue with the 406 release. Where can I get the hotfix? I checked Support page and the UpdateManager and just the 406 comes across. Also, do the 416 release's release notes note that this was a fixed bug?

Posted: January 11, 2011 1:16 PM

Hello Shawn,

You can set the culture in IntializeLayout or in PageLoad event. Please see the attached sample.
In my test, I am using WebGrid 7 build 416 and WebUIFramework build 767. However, I could not replicate the issue. So, would you mind to send us a simple runable sample that replicates the issue?

Regards,
Handy

 

I have attached a screen shot showing 3 DateFields with an alert box showing the field's value which is 1/5/2011, 1-5-2011, and 1.5.2011 respectfully. You will notice the first field is not rendered properly (05-Jan-2011) but the others are 01-May-2011. I have also enclosed both the client and server-side code.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UKCultureBug.aspx.cs" Inherits="UKCultureBug" %>
<%@ Register TagPrefix="iswebgrid" Namespace="ISNet.WebUI.WebGrid" Assembly="ISNet.WebUI.WebGrid" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD runat=server>
		<title>UKCultureBug</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		 
          <script type="text/javascript">
              function DoRowSelect(controlId, tblName, rowIndex, rowEl)
               {
                  var grid = ISGetObject(controlId);
                  var table = grid.Tables[tblName];
                  var currentRow = table.ToRowObject(rowEl); // convert from element to WebGridRow object.
                  var cells = currentRow.GetCells();
                  var field1 = cells.GetNamedItem("ClaimDateOfLossFrom");                  
                  var field2 = cells.GetNamedItem("ClaimAdvisedDate");
                  var field3 = cells.GetNamedItem("DateOfEvent");
                  window.alert(field1.Value + " - " + field2.Value + " - " + field3.Value);
              }
          </script>
	
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
		
			<iswebgrid:webgrid id=WebGrid1 runat="server"
			    DefaultStyleMode="Elegant"
                Height="100%" Width="100%" UseDefaultStyle="True" EnableViewState="false" ViewStateStorage="None"
                OnInitializeDataSource="WebGrid1_OnInitializeDataSource" OnInitializeLayout="WebGrid1_OnInitializeLayout"
                
                 
              >
                <LayoutSettings AllowBatchUpdate="true" BatchUpdateSettings-PromptUnsavedChanges="false" NewRowLostFocusAction="AlwaysUpdate"
                    AllowAddNew="Yes" AllowEdit="Yes" AllowDelete="Yes" EditOnClick="True" AutoHeight="false" RowHeightDefault="22px"
                    AutoWidth="false" AllowColumnFreezing="Yes" AllowExport="No" AllowFilter="No"
                    AllowSelectColumns="Yes" AllowSorting="No" AlwaysShowHelpButton="False" ApplyFiltersKey="Enter"
                    CellPaddingDefault="0" FilterBarVisible="True" HideColumnsWhenGrouped="Default"
                    InProgressUIBehavior="ChangeCursorToHourGlass"
                    PagingExportMode="ExportAllData" PagingMode="VirtualLoad" ResetNewRowValuesOnError="False"
                    ShowFilterStatus="True" VerboseEditingInformation="False" VirtualPageSize="200">
                    <ClientSideEvents OnRowSelect="DoRowSelect"  />
                    <FrameStyle>
                        <BorderSettings>
                            <Top Style="none" />
                            <Bottom Style="none" />
                            <Left Color="#6593cf" Style="solid" Width="1" />
                            <Right Color="#6593cf" Style="solid" Width="1" />
                        </BorderSettings>
                    </FrameStyle>
                    <HeaderStyle CssClass="WebGridHeaderStyle" />
                    <StatusBarStyle CssClass="WebGridStatusBarStyle" />
                    <StatusBarCommandStyle Active-CssClass="WebGridStatusBarCommandStyleActive" Normal-CssClass="WebGridStatusBarCommandStyleNormal"
                        Over-CssClass="WebGridStatusBarCommandStyleOver">
                        <Normal CssClass="WebGridStatusBarCommandStyleNormal" />
                        <Over CssClass="WebGridStatusBarCommandStyleOver" />
                        <Active CssClass="WebGridStatusBarCommandStyleActive" />
                    </StatusBarCommandStyle>
                    <FilterRowStyle CssClass="WebGridFilterRowStyle" />
                    <PreviewRowStyle CssClass="WebGridRowStyle" />
                    <RowStyle CssClass="WebGridRowStyle" />
                    <QuickFilterBarStyle CssClass="WebGridRowStyle" />
                    <RowHeaderStyle CssClass="WebGridRowHeaderStyle" />
                    <SelectedRowStyle CssClass="WebGridSelectedRowStyle" />
                    <EditFocusCellStyle CssClass="WebGridRowStyle" />
                    <FocusCellStyle CssClass="WebGridRowStyle" />
                    <LostFocusRowStyle CssClass="WebGridRowStyle" />
                    <NewRowStyle CssClass="WebGridRowStyle" />
                    <SortedColumnStyle CssClass="WebGridSortedColumnStyle" />
                    <AlternatingRowStyle CssClass="WebGridAlternatingRowStyle" />
                    <EditTextboxStyle CssClass="WebGridEditTextboxStyle" />
                    <FreezePaneSettings AbsoluteScrolling="True" ActiveFrozenColumns="3" MaxFrozenColumns="3"
                        ShowInContextMenu="False" ShowSplitterLine="False" SplitterLineColor="ActiveBorder"
                        SplitterLineWidth="1" />
                </LayoutSettings>
                <RootTable Caption="Claims Transaction" DataKeyField="UniqueID" ColumnFooters="Yes"> 
					  	 		<Columns>	
					  	 		  <ISWebGrid:WebGridColumn Caption="UniqueID" Name="UniqueID" DataType="System.Integer"
                                                 ColumnType="Text" EditType="NoEdit" NewRowEditType="NoEdit" FilterEditType="NoEdit"
                                                 Width="0px" Visible="false">
                        </ISWebGrid:WebGridColumn>
                        
 <ISWebGrid:WebGridColumn Caption="Date of Loss" Name="ClaimDateOfLossFrom" DataMember="ClaimDateOfLossFrom"
                            DataFormatString="dd-MMM-yyyy" DataType="System.String" ColumnType="Text" EditType="CalendarCombo"
                            NewRowEditType="CalendarCombo" FilterEditType="CalendarCombo" Width="75px">
                        </ISWebGrid:WebGridColumn>                                                                                                                
                        <ISWebGrid:WebGridColumn Caption="Reported Date" Name="ClaimAdvisedDate" DataMember="ClaimAdvisedDate"
                            DataFormatString="dd-MMM-yyyy" DataType="System.String" ColumnType="Text" EditType="CalendarCombo"
                            NewRowEditType="CalendarCombo" FilterEditType="CalendarCombo" Width="90px">
                        </ISWebGrid:WebGridColumn>   
                        <ISWebGrid:WebGridColumn Caption="Event Date" Name="DateOfEvent" DataMember="DateOfEvent"
                            DataFormatString="dd-MMM-yyyy" DataType="System.String" ColumnType="Text" EditType="CalendarCombo"
                            NewRowEditType="CalendarCombo" FilterEditType="CalendarCombo" Width="90px">
                        </ISWebGrid:WebGridColumn>

					</Columns>
				</RootTable>
			</iswebgrid:webgrid>
			 
		</form>
	</body>
</HTML>
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ISNet.WebUI.WebGrid;

public partial class UKCultureBug : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void WebGrid1_OnInitializeLayout(object sender, ISNet.WebUI.WebGrid.LayoutEventArgs e)
    {
        // Set the user's culture
        this.SetUserCulture();
    }

    protected void WebGrid1_OnInitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
    {

        List<MyClass> data = new List<MyClass>();
        data.Add(new MyClass());
        data.Add(new MyClass());
        data.Add(new MyClass());
        e.DataSource = data;
    }

    private void SetUserCulture()
    {
        // Get/Set culture's format
        CultureInfo culture = new CultureInfo("en-GB");
        this.WebGrid1.LayoutSettings.Culture = culture;
        this.WebGrid1.LayoutSettings.TextSettings.Language = LanguageMode.UseCulture;
        this.WebGrid1.LayoutSettings.TextSettings.UseLanguage = culture.ToString();
    }

    /// <summary>
    /// Perform batch update on the Inurings WebGrid control's source
    /// </summary>
    /// <param name="source">Source to update</param>
    /// <returns>Updated source after batch update</returns>
    public void PerformInuringsGridBatchUpdate(object sender, EventArgs e)
    {
        // Get changes
        List<WebGridRowChanges> rowChanges = this.WebGrid1.GetChanges();

        // Perform change updates
        foreach (WebGridRowChanges rowChangesItem in rowChanges)
        {
            if (rowChangesItem.KeyValue != null)
            {
                switch (rowChangesItem.RowState)
                {
                    // Add
                    case RowState.Added:

                        break;
                    // Update
                    case RowState.Modified:

                        break;
                    // Delete
                    case RowState.Deleted:
                        break;
                }
            }
        }
    }

    private class MyClass
    {
       #region Variables
        private string _uniqueID = Guid.NewGuid().ToString();      
        private DateTime? _claimDateOfLossFrom = null;
        private DateTime? _claimAdvisedDate = null;
        private DateTime? _dateOfEvent = null;

        #endregion Variables

        #region Properties

        public string UniqueID
        {
            get { return this._uniqueID; }
            set { this._uniqueID = value; }
        }

        /// <summary>
        /// Claims Date Of Loss From
        /// </summary>
        public DateTime? ClaimDateOfLossFrom
        {
            get { return this._claimDateOfLossFrom; }
            set { this._claimDateOfLossFrom = value; }
        }

        /// <summary>
        /// Claim Advised Date
        /// </summary>
          public DateTime? ClaimAdvisedDate
        {
            get { return this._claimAdvisedDate; }
            set { this._claimAdvisedDate = value; }
        }

        /// <summary>
        /// Date Of Event
        /// </summary>
         public DateTime? DateOfEvent
        {
            get { return this._dateOfEvent; }
            set { this._dateOfEvent = value; }
        }

        #endregion Properties

        #region Constructors

        /// <summary>
        /// GeniusClaimAmountMaster constructor
        /// </summary>
        public MyClass()
        {
            this._claimDateOfLossFrom = DateTime.Now;
            this._claimAdvisedDate = DateTime.Now;
            this._dateOfEvent = DateTime.Now;
        }

        #endregion Constructors
    }    
}

 

Posted: January 7, 2011 10:42 AM

Tyr using CSS instead of directly modifying the cell background color style. Here is the snippet:

<style type="text/css">
.CustomRowColor
{
background-color: "#DC143C" !important;
}
</style>

Instead of:

cell.style.setAttribute("backgroundColor", "Red", true);

Try:

cell.className += " CustomRowColor";


 

 

This is on the right track. However, it might be necessary to remove that style. Here's a quick function that allows the adding/removing of a particular CSS to satisfy this problem.


Thanks for your help!

 

function WebGrid_SetRowCSS(gridID, row, css, addCSS) 
{
    var returnVal = false;

    try 
    {    
        // Set row's CSS
        if (row == null) { return false; }
        var rowCells = row.GetCells();
        if (rowCells == null) { return false; }

        // Get grid
        var grid = WebGrid_GetGrid(gridID);
        if (grid == null) { return false; }

        // Check if adding or removing CSS
        // NOTE: Assume adding
        if (typeof (addCSS) == "undefined") { addCSS = true; }
        
        // Get table's column length and starting position (Check Grouped Columns)
        var columnLength = grid.RootTable.Columns.length;
        indexNumber = (grid.RootTable.GroupedColumns.length > 0) ? 2 : 1;        
        var rowObject = row;
        if (rowObject.Type.toUpperCase() != "GROUPHEADER") 
        {
            for (var i = 1; i <= columnLength; i++)
            {
                var rowElement = rowObject.RowElement;
                if (rowElement != null) 
                {
                    var cell = rowElement.cells[i];
                    if (cell != null) 
                    {
                        // Set/Remove CSS
                        // NOTE: Only set CSS if it doesn't already exist
                        var cellCSS = cell.className;
                        if (addCSS == true)
                        {
                            if (cellCSS.match(css) == null)
                            {
                                cell.className += " " + css;
                            }
                        }
                        else 
                        {
                            cell.className = cellCSS.replace(css, "");
                        }                          
                    }
                }
            }
        }
        
        returnVal = true;
    }
    catch (ex) { ShowJSException(ex); returnVal = false; }

    return returnVal;
}
I proprose applying a custom attribute during the WebGrid_SetRowBackgroundColor and re-apply the custom style during the AfterExitEditMode if the custom attribute exist.

I also found an alternative if you do not wish to have the modified row style in the Grid at all, you could just disable it in the BatchUpdate settings.
<BatchUpdateSettings HighlightChanges="false" />
This way, you do not have to implement the AfterExitEditMode event handler.

 

I don't see how making ANY changes within the AfterExitEditMode event will work given the background color is changed after? I provided sample code above to prove that.

All times are GMT -5. The time now is 2:20 AM.
Previous Next