This is a migrated thread and some comments may be shown as answers.

Can't see sum in footer in IE

4 Answers 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 19 Apr 2012, 03:20 PM
Hi,

After upgrading to 2012.1.411 version, the sum of the last column might be hidden in IE.
This problem was not in 2012.1.215.

It only occurs when there is a footer in the last column and that footer is aligned right.
Must also use scrolling and static headers.

Sample:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="testgrid.aspx.vb" Inherits="WebApplication1.testgrid" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="s" runat="server">
    </asp:ScriptManager>
    <div>
        <telerik:RadGrid ID="rg" runat="server">
            <ClientSettings>
                <Scrolling AllowScroll="true" ScrollHeight="200px" UseStaticHeaders="true" />
            </ClientSettings>
            <MasterTableView ShowFooter="True" AutoGenerateColumns="false">
                <Columns>
                    <telerik:GridBoundColumn DataField="string"></telerik:GridBoundColumn>
                    <telerik:GridNumericColumn DataField="number" Aggregate="Sum">
                        <ItemStyle HorizontalAlign="Right" />
                        <FooterStyle HorizontalAlign="Right" />
                    </telerik:GridNumericColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
Public Class testgrid
    Inherits System.Web.UI.Page
 
    Private Sub rg_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rg.NeedDataSource
        Dim dt As New DataTable()
 
        dt.Columns.Add("string", GetType(String))
        dt.Columns.Add("number", GetType(Integer))
 
        For i As Integer = 1 To 7
            dt.Rows.Add({"test", i})
        Next
 
        rg.DataSource = dt
    End Sub
End Class

As you can see in this sample, the sum of the "number" column will be cut off.

Regards
Caesar

4 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 24 Apr 2012, 09:58 AM
Hello,

The behavior you are observing is an already known bug, which will be fixed in one of the next major releases.

Currently you could use the following work-around:

<script type="text/javascript">
 
        Telerik.Web.UI.GridScrolling.prototype.setHeaderAndFooterDivsWidth = function () {
            var grid = this._owner,
            gridEl = grid.get_element(),
            master = grid.get_masterTableView(),
            dataDiv = grid.GridDataDiv,
            headerDiv = grid.GridHeaderDiv;
 
            if (!master || !dataDiv || !headerDiv) {
                return;
            }
 
            var masterEl = master.get_element(),
            scrollBarHeight = Telerik.Web.UI.Grid.getScrollBarHeight(),
            isIE = navigator.userAgent.toLowerCase().indexOf("msie") > -1;
 
            if (isIE) {
                if (dataDiv.offsetWidth > 0 &&
                    (masterEl.offsetWidth >= gridEl.offsetWidth - scrollBarHeight || masterEl.offsetHeight > dataDiv.offsetHeight) &&
                    (document.compatMode && document.compatMode != "BackCompat")) //Not Quirks Mode
                {
                    var width = dataDiv.offsetWidth - scrollBarHeight;
                    if (width > 0) {
                        if ($telerik.isIE6 && this._onResizeDelegate) // IE6 fires widnow resize if element's width is greater then the document
                        {
                            if (Telerik.Web.UI.Grid.hasEventAttached(window, "resize", this._onResizeDelegate))
                                $removeHandler(window, "resize", this._onResizeDelegate);
                        }
 
                        headerDiv.style.width = width + "px";
 
                        if ($telerik.isIE6 && this._onResizeDelegate) {
                            var that = this;
                            setTimeout(function () { $addHandler(window, "resize", that._onResizeDelegate) }, 0);
                        }
                    }
                }
                else if (dataDiv.offsetWidth > 0) {
                    if ($telerik.isIE6 && this._onResizeDelegate) // IE6 fires widnow resize if element's width is greater then the document
                    {
                        if (Telerik.Web.UI.Grid.hasEventAttached(window, "resize", this._onResizeDelegate))
                            $removeHandler(window, "resize", this._onResizeDelegate);
                    }
 
                    headerDiv.style.width = dataDiv.offsetWidth + "px";
 
                    if ($telerik.isIE6 && this._onResizeDelegate) {
                        var that = this;
                        setTimeout(function () { $addHandler(window, "resize", that._onResizeDelegate) }, 0);
                    }
                }
            }
 
            var isRtl = Telerik.Web.UI.Grid.IsRightToLeft(headerDiv) && Telerik.Web.UI.Grid.IsScrollOnLeftSide()
 
            if (masterEl.offsetWidth >= gridEl.offsetWidth - scrollBarHeight ||
                masterEl.offsetHeight > dataDiv.offsetHeight ||
                !isIE) {
                if ((!isRtl && parseInt(headerDiv.style.marginRight) !== scrollBarHeight) ||
                    (isRtl && parseInt(headerDiv.style.marginLeft) !== scrollBarHeight)) {
                    if (!isRtl) {
                        headerDiv.style.marginRight = scrollBarHeight + "px";
                        headerDiv.style.marginLeft = headerDiv.style.paddingRight = "";
                    }
                    else {
                        headerDiv.style.marginLeft = scrollBarHeight + "px";
                        headerDiv.style.marginRight = headerDiv.style.paddingRight = "";
                    }
                }
            }
            else {
                headerDiv.style.paddingLeft = headerDiv.style.paddingRight = "";
            }
 
            var footerDiv = this._owner.GridFooterDiv;
            //This is needed to refresh the layout in WebKit browsers after we have applied margin and padding
            setTimeout(function () {
                if (dataDiv.clientWidth === dataDiv.offsetWidth) {
                    headerDiv.style.width = "100%";
                    headerDiv.style.marginRight = headerDiv.style.paddingRight = "";
                    headerDiv.style.marginLeft = headerDiv.style.paddingLeft = "";
                }
 
                if (footerDiv) {
                    footerDiv.style.paddingRight = headerDiv.style.paddingRight;
                    footerDiv.style.paddingLeft = headerDiv.style.paddingLeft;
                    footerDiv.style.width = headerDiv.style.width;
                    //FF3
                    footerDiv.style.marginRight = headerDiv.style.marginRight;
                    footerDiv.style.marginLeft = headerDiv.style.marginLeft;
                }
            }, 0);
 
 
            var groupPanel = this._owner._groupPanel,
            masterHeader = this._owner.get_masterTableViewHeader();
 
            if (groupPanel && groupPanel._items.length > 0 && isIE && masterHeader) {
                masterEl.style.width = masterHeader.get_element().offsetWidth + "px";
            }
        }
 
        </script>

All the best,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Andreas
Top achievements
Rank 1
answered on 22 May 2012, 08:37 PM
Hi,

Well it isn't fixed in the 2012 Q2 Beta...
It will still be fixed in 2012 Q2?

Regards
Caesar
0
Andreas
Top achievements
Rank 1
answered on 15 Jun 2012, 10:47 AM
Not fixed in 2012 Q2...
0
Andrey
Telerik team
answered on 19 Jun 2012, 03:42 PM
Hi,

As you could verify from my last post I said that the bug will be fixed in one of the next releases, not necessarily in the current release.

While waiting for the bug to be fixed you could use the provided work-around.

Additionally, you could use our PITS system to monitor the bug fixing process:

You can follow the PITS Issue by its ID: 11543
Here you can find the PITS Issue: Public URL

Kind regards,
Andrey
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Andreas
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Andreas
Top achievements
Rank 1
Share this question
or