Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
117 views

I'm having difficulty getting the exception from the OnDataBindingFailed event

the event fires as expected, but the eventArgs object doesn't have the methods

     get_exception() - returns the deserialized response text.
     get_responseText() - returns the response text from the service.

as described in this doc link

     https://docs.telerik.com/devtools/aspnet-ajax/controls/listview/data-binding/client-side/api

The error that is showing on the console is

     Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource ... blah blah blah

what am in missing?

Jason
Top achievements
Rank 1
 answered on 10 Sep 2018
3 answers
858 views

this my aspx page

<%@ Page Title="" Language="C#" MasterPageFile="~/Modules/Module.Master" AutoEventWireup="true" CodeBehind="DataExporter.aspx.cs" Inherits="HelmOnline.Web.Modules.DataExporter.DataExporter" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ModuleHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ModuleContent" runat="server">

    <div style="margin: 10px; height: 100%;">

        <style type="text/css">
            .rightAlign {
                float: right;
            }

            .pad1 {
                padding-right: 20px
            }
        </style>

        <telerik:RadScriptBlock runat="server">
            <script type="text/javascript">                

                function OpenHistoryTransaction(sender, transactionid, customerid, customersetupid, employeeid) {

                    var dialogWindow = $find("<%=RadWindow1.ClientID%>");

                    if (transactionid == 0)
                    { dialogWindow.set_title("Add Transaction"); }
                    else
                    { dialogWindow.set_title("Modify Transaction"); }

                    var baseUrl = "Dialog/AddEditHistoryTransaction.aspx";
                    baseUrl = baseUrl + "?";
                    baseUrl = baseUrl + "transactionid=" + transactionid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "customerid=" + customerid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "customersetupid=" + customersetupid;
                    baseUrl = baseUrl + "&";
                    baseUrl = baseUrl + "employeeid=" + employeeid;
                    dialogWindow.set_navigateUrl(baseUrl)
                    dialogWindow.set_modal(true);
                    dialogWindow.show();
                }

                function OnClientCloseHandler(sender, args) {
                    var btnRefreshGrids = $find("<%=btnRefreshGrids.ClientID%>");
                    btnRefreshGrids.click();
                }

            </script>
        </telerik:RadScriptBlock>

        <telerik:RadWindowManager RenderMode="Lightweight" ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="true" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow RenderMode="Lightweight" ID="RadWindow1" runat="server" Height="325" Width="525" NavigateUrl="~/Modules/PaidTimeOff/Dialog/AddEditHistoryTransaction.aspx" OnClientClose="OnClientCloseHandler" Behaviors="Close" />
            </Windows>
        </telerik:RadWindowManager>

        <telerik:RadAjaxManager ID="RadRadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="100%" />
                        <telerik:AjaxUpdatedControl ControlID="RadGrid2" UpdatePanelHeight="100%" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="btnRefreshGrids">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="btnRefreshGrids" />
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="100%" />
                        <telerik:AjaxUpdatedControl ControlID="RadGrid2" UpdatePanelHeight="100%" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
            <ClientEvents />
        </telerik:RadAjaxManager>

        <telerik:RadAjaxPanel runat="server" ID="pDataExporter" PostBackControls="btnExportGrid" Height="100%">
            <div style="margin: 0px; height: 5%;">
                <telerik:RadButton ID="btnRefreshGrids" Text="Refresh" OnClick="btnRefreshGrids_Click" runat="server" Style="display: none;" />
                <telerik:RadButton runat="server" ID="btnExport" Text="Export Data" Visible="true" OnClick="btnExport_Click"/>
            </div>
            <div style="margin: 0px; height: 95%;" id="gridContainer">
                <div style="margin: 0px; height: 50%;">
                    <asp:ImageButton ID="btnExportGrid" runat="server" ImageUrl="/Images/Excel_XLSX.png" Height="24" Width="24" OnClick="btnExportGrid_Click" AlternateText="ExportToExcel" />
                    <telerik:RadGrid runat="server" ID="RadGrid1" Width="100%" Height="90%" AutoGenerateColumns="false" AllowPaging="False" AllowSorting="true" ShowGroupPanel="false" PageSize="10" RenderMode="Classic" AllowFilteringByColumn="true" GroupingSettings-CaseSensitive="false" OnNeedDataSource="RadGrid1_NeedDataSource" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged">
                        <MasterTableView TableLayout="Fixed">
                            <Columns>
                                <telerik:GridBoundColumn SortExpression="ExporterID" HeaderText="ExporterID" HeaderStyle-Width="0" HeaderButtonType="TextButton" DataField="ExporterID" DataFormatString="{0:d}" AllowFiltering="true" />
                                <telerik:GridBoundColumn SortExpression="StoredProcName" HeaderText="StoredProcName" HeaderStyle-Width="300" HeaderButtonType="TextButton" DataField="StoredProcName" DataFormatString="{0:d}" AllowFiltering="true" />
                                <telerik:GridBoundColumn SortExpression="Description" HeaderText="Description" HeaderButtonType="TextButton" DataField="Description" DataFormatString="{0:d}" AllowFiltering="true" />
                            </Columns>
                        </MasterTableView>
                        <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" EnablePostBackOnRowClick="true" Selecting-AllowRowSelect="true">
                            <Selecting AllowRowSelect="True"></Selecting>
                            <Resizing AllowRowResize="False" AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False"></Resizing>
                            <Scrolling UseStaticHeaders="true" AllowScroll="true" />
                        </ClientSettings>
                    </telerik:RadGrid>
                </div>
                <div style="margin: 0px; height: 50%;">
                    <telerik:RadGrid Width="100%" Height="80%" ID="RadGrid2" OnNeedDataSource="RadGrid2_NeedDataSource" OnItemDataBound="RadGrid2_ItemDataBound" runat="server" AutoGenerateColumns="false" AllowPaging="False" AllowSorting="false" ShowGroupPanel="false" PageSize="10" RenderMode="Classic" AllowFilteringByColumn="false" GroupingSettings-CaseSensitive="false">
                        <MasterTableView TableLayout="Fixed">
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="NameColumn"  HeaderStyle-Width="150" SortExpression="ColumnName" HeaderText="Paramter" HeaderButtonType="TextButton" DataField="ColumnName" />
                                <telerik:GridBoundColumn UniqueName="TypeColumn"  HeaderStyle-Width="0" SortExpression="ColumnType" HeaderText="ColumnType" HeaderButtonType="TextButton" DataField="ColumnType" />
                                <telerik:GridBoundColumn UniqueName="OrderColumn" HeaderStyle-Width="0" SortExpression="ColumnOrder" HeaderText="ColumnOrder" HeaderButtonType="TextButton" DataField="ColumnOrder" />
                                <telerik:GridTemplateColumn UniqueName="ValueColumn" HeaderText="Value"/>                                
                            </Columns>
                        </MasterTableView>
                        <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True" EnablePostBackOnRowClick="false">
                            <Selecting AllowRowSelect="false"></Selecting>
                            <Resizing AllowRowResize="false" AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="False"></Resizing>
                            <Scrolling UseStaticHeaders="true" AllowScroll="true" />
                        </ClientSettings>
                    </telerik:RadGrid>                                        
                </div>                                                
            </div>
        </telerik:RadAjaxPanel>
    </div>    
</asp:Content>

 

This is the codebehind

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using xi = Telerik.Web.UI.ExportInfrastructure;
using Telerik.Web.UI.GridExcelBuilder;
using HelmOnline.Web.Common.Context;


namespace HelmOnline.Web.Modules.DataExporter
{
    public partial class DataExporter : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                this.RadGrid1.Rebind();
                
            }

        }

        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            using (var client = new svcHelm.HelmClient())
            {
                var grid = sender as RadGrid;
                grid.DataSource = client.DataExporterReportsByUserID(SecurityContext.UserId);

            }
        }

        protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e)
        {
            GridDataItem selectedItem = (GridDataItem)RadGrid1.SelectedItems[0];
            Session["RowIndex"] = selectedItem.ItemIndex;// Gets the index of currently selected row
            this.RadGrid2.Rebind();
            RadGrid2.Visible = true;                        
        }
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadGrid2_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            int ExporterID = 0;
            string StoredProcName = "";
            
            if (this.RadGrid1.SelectedItems != null)
            {
                if (this.RadGrid1.SelectedItems.Count > 0)
                {
                    var selectGridItem = (Telerik.Web.UI.GridDataItem)this.RadGrid1.SelectedItems[0];
                    ExporterID = int.Parse(selectGridItem["ExporterID"].Text);
                    StoredProcName = selectGridItem["StoredProcName"].Text;
                    
                    using (var client = new svcHelm.HelmClient())
                    {
                        var grid = sender as RadGrid;
                        grid.DataSource = client.DataExporterObjectColumns(StoredProcName, SecurityContext.UserName);
                    }
                }
            }



        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnRefreshGrids_Click(object sender, EventArgs e)
        {
            string selectedEmployeeId = string.Empty;
            for (int i = 0; i < RadGrid1.Items.Count; i++)
            {
                if (RadGrid1.Items[i].Selected)
                {
                    selectedEmployeeId = RadGrid1.Items[i]["EmployeeID"].Text;
                }
            }

            this.RadGrid1.Rebind();

            if (selectedEmployeeId.Length > 0)
            {
                for (int i = 0; i < RadGrid1.Items.Count; i++)
                {
                    if (selectedEmployeeId == RadGrid1.Items[i]["EmployeeID"].Text)
                    {
                        RadGrid1.Items[i].Selected = true;
                    }
                }
            }

            this.RadGrid2.Rebind();
        }

        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnExportGrid_Click(object sender, ImageClickEventArgs e)
        {
            RadGrid1.ExportSettings.Excel.Format = (GridExcelExportFormat)Enum.Parse(typeof(GridExcelExportFormat), "Xlsx");
            RadGrid1.ExportSettings.IgnorePaging = true;
            RadGrid1.ExportSettings.ExportOnlyData = true;
            RadGrid1.ExportSettings.OpenInNewWindow = true;
            RadGrid1.MasterTableView.ExportToExcel();

        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if(e.Item is GridDataItem){
                var gdi = (GridDataItem)e.Item;
                if (gdi != null){                    
                    var data = (HelmOnline.Web.svcHelm.DataExporterObjectColumn)gdi.DataItem;
                    if(data != null){
                        Control control = null;
                        switch (data.ColumnType.ToLower()){
                            case "int":
                                control = new RadNumericTextBox();
                                ((RadNumericTextBox)control).NumberFormat.DecimalDigits = 0;
                                ((RadNumericTextBox)control).ShowSpinButtons = true;                                
                                control.ID = "intControl";
                                control.DataBind();
                                break;
                            case "decimal":
                                control = new RadNumericTextBox();                                
                                control.ID = "decimalControl";
                                control.DataBind();
                                break;
                            case "money":
                                control = new RadNumericTextBox();
                                ((RadNumericTextBox)control).NumberFormat.DecimalDigits = 2;
                                ((RadNumericTextBox)control).ShowSpinButtons = true;
                                control.ID = "moneyControl";
                                control.DataBind();
                                break;
                            case "datetime":
                                control = new RadDatePicker();
                                control.ID = "datetimeControl";
                                control.DataBind();
                                break;
                            case "varchar":
                                control = new RadTextBox();
                                control.ID = "varcharControl";
                                control.DataBind();
                                break;
                            default:
                                control = new RadTextBox();
                                control.ID = "defaultControl";
                                control.DataBind();
                                break;
                        }

                        if(control != null){
                            gdi["ValueColumn"].Controls.Add(control);
                            gdi["ValueColumn"].DataBind();
                        }                        
                    }                                        
                }
            }

            
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnExport_Click(object sender, EventArgs e)
        {
            var paramDictionary = new Dictionary<string, object>();
            var grid = this.RadGrid2;
                        
            foreach (GridDataItem dataItem in grid.MasterTableView.Items){
                Control control = null;
                var pName = dataItem["NameColumn"].Text;
                var pType = dataItem["TypeColumn"].Text;
                var pOrder = int.Parse(dataItem["OrderColumn"].Text);
                object pValue = null;

                //CellValue = CType(RadGrid1.Items(i).FindControl("YourControlID"), TextBox).Text
                    //bool boolValue = (item["GridCheckBoxColumnUniqueName"].Controls[0] as CheckBox).Checked;


                switch (pType.ToLower()){
                    case "int":
                        //var column = dataItem["ValueColumn"].TemplateControl;
                        //control = column.FindControl("intControl");
                        //pValue = int.Parse(((RadNumericTextBox)control).Value.ToString());

                        var column = dataItem["ValueColumn"].Text;//value inputed by user is not here

                        //RadNumericTextBox intcontrol = (RadNumericTextBox)dataItem["ValueColumn"].FindControl("intControl");
                        RadNumericTextBox intcontrol = (RadNumericTextBox)dataItem.FindControl("intControl");

                        pValue = int.Parse(intcontrol.Value.ToString());
                        break;
                }
            }
        }
    }

}

 

I am trying to get the values of the columns of the rad grid. I can get all the static values but not the value of the template column where the user would input values.

 

 

 

Attila Antal
Telerik team
 answered on 10 Sep 2018
1 answer
530 views

I have a Telerik Grid in which I have declared Radbutton which is populated in itemdatabound event. I have disabled it with condition from database.

But When ever the page index is Changed at the same item index the button is disabled.

 

Please kindly suggest a better way to do so.

 

Here is the code inside the ItemDataBound event

 

if (e.Item is GridDataItem)
                {
                    GridDataItem dataItem = e.Item as GridDataItem;
                    if ((rddlLogLevel.SelectedValue).Contains("ERROR") == true)
                    {
                        DataSet ds = (DataSet)Session["LogErrors"];
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            if (ds.Tables[0].Rows[e.Item.ItemIndex]["PSRNumber"].ToString() == "" && ds.Tables[0].Rows[e.Item.ItemIndex]["LeretaPSRLogID"].ToString() == "")
                            { (dataItem["Action"].FindControl("rbtnCreatePSR") as RadButton).Enabled = true; }
                            else if (ds.Tables[0].Rows[e.Item.ItemIndex]["PSRNumber"].ToString() == "" && ds.Tables[0].Rows[e.Item.ItemIndex]["LeretaPSRLogID"].ToString() != "")
                            { (dataItem["Action"].FindControl("rbtnCreatePSR") as RadButton).Enabled = false; }
                            else { (dataItem["Action"].FindControl("hylnk_PSR") as HyperLink).Visible = true; }
                        }
                    }
                    else { (dataItem["Action"].FindControl("rbtnCreatePSR") as RadButton).Enabled = false; }

Marin Bratanov
Telerik team
 answered on 10 Sep 2018
4 answers
135 views

I have a RadGrids that resize the height with the window.  That has been working for several years in 6 different grids with almost identical code.  In one of these grids all of sudden, on a new page/refresh the grid rows go to about 10 pixels high.  If I resize the window it all goes back to normal. I have tried many different things to get open a new page for the grid to be 100% in the panel it is in.  I am lost, I did not change anything, the ASP.NET Ajax drop was working fine and suddenly this problem appears with one of six grids. Programming is not supposed to work this way.

<script type="text/javascript">
    $(document).ready(function () {
        SetGridDiv();             
    });
    window.onresize = function (event) {
        SetGridDiv();
    }
    function SetGridDiv() {
        var height = $(window).height();
        var gridDiv = document.getElementById("MainContent_GridDiv");
        height = height - 100;
        height += "px";
        gridDiv.style.height = height;
    }
</script>
<div id="GridDiv" runat="server" >
    <asp:panel runat="server" ID="HomeGridPanel"  CssClass="windowPercent" >
        <telerik:RadGrid runat="server" ID="OrganizationsGrid" OnItemCommand="Grid_ItemCommand">
            <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" />
            </ClientSettings>
        </telerik:RadGrid>
    </asp:panel>
</div>

 

And the C# .cs code.

RadGrid adminGrid = OrganizationsGrid;
                adminGrid.NeedDataSource += new GridNeedDataSourceEventHandler(AdminGrid_NeedDataSource);
                adminGrid.Skin = "Default";
                adminGrid.AutoGenerateColumns = false;
                adminGrid.EnableViewState = false;
                adminGrid.GroupingEnabled = false;
                adminGrid.AllowPaging = true;
                adminGrid.PageSize = 500;
                adminGrid.Height = Unit.Percentage(100);
                adminGrid.EnableHeaderContextMenu = true;
                adminGrid.AllowSorting = true;
                adminGrid.AllowFilteringByColumn = true;
                adminGrid.AllowMultiRowSelection = false;
                adminGrid.AllowAutomaticDeletes = true;
                adminGrid.MasterTableView.HierarchyDefaultExpanded = true;
                adminGrid.ClientSettings.EnableRowHoverStyle = true;
                adminGrid.ClientSettings.Selecting.AllowRowSelect = true;
                adminGrid.ClientSettings.Selecting.EnableDragToSelectRows = true;
                adminGrid.ClientSettings.ReorderColumnsOnClient = true;
                adminGrid.ClientSettings.AllowColumnsReorder = true;
                adminGrid.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Reorder;
                adminGrid.ClientSettings.Virtualization.EnableVirtualization = true;
                adminGrid.ClientSettings.Virtualization.InitiallyCachedItemsCount = 2000;
                adminGrid.ClientSettings.Scrolling.AllowScroll = true;
                adminGrid.ClientSettings.Scrolling.UseStaticHeaders = true;
                adminGrid.ClientSettings.Scrolling.ScrollHeight = Unit.Percentage(100);
                adminGrid.ClientSettings.Resizing.AllowColumnResize = true;
                adminGrid.PagerStyle.Mode = GridPagerMode.NextPrevNumericAndAdvanced;
                adminGrid.GroupingSettings.CaseSensitive = false;
                //Add columns to Grid
                GridBoundColumn boundColumn;
                boundColumn = new GridBoundColumn();
                boundColumn.Display = false;
                boundColumn.DataField = OrganizationListData.FIELD_ID;
                boundColumn.HeaderText = OrganizationListData.FIELD_ID;
                boundColumn.ShowFilterIcon = false;
                adminGrid.MasterTableView.Columns.Add(boundColumn);

The columns and rows are all done in server code.

This all just so strange.  The grid rows appear correctly and then a flash later shrinks to half a row. Resize and all works fine.

I have tried delayed multiple resize SetGridDiv calls, no luck.

I have tried setting the grid height to 100%, the panel windowPercent class sets the height to 100% already.

I have tried setting a row count.

The Grid samples seem to do nothing to get grids with height.  They use class demo-container and no-bg which are not defined in the sample code.

 

This is a MAJOR product disaster, an important grid starting out as a half row. If this cannot be fixed I will be forced to find other tools.

 

Attila Antal
Telerik team
 answered on 07 Sep 2018
7 answers
847 views

Hi, we have 404 page configured in webconfig: so that when a non-existent page like this https://www.ximnet.com.my/something or page with errors will go to a friendly 404 page.

But for https://www.ximnet.com.my/Telerik.Web.UI.WebResource.axd, it cannot redirect to 404 page.

How can we redirect the axd to our 404 page?
We need this because in Acunetix scanning, it will tag this page as showing "Application Error Message"

Thanks.

 

HSLaw
Top achievements
Rank 1
 answered on 07 Sep 2018
2 answers
313 views

I have my RadPageView setup with ContentURL, but on come conditions i need to redirect to different URL.

Nothing i tried works.

Help please

David
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 06 Sep 2018
5 answers
267 views
We are facing a performance problem, when using RadGrid in RadSpliiter.

We have a MasterPage with multiple RadSplitter which should resize with window. Here is the code:

<body style="margin: 0px; height: 100%; overflow: hidden;" scroll="no">
    <form id="form1" runat="server" style="height: 100%; margin: 0px" method="post">
    <telerik:RadScriptManager runat="server" ID="ScriptManager" ScriptMode="Release">
    </telerik:RadScriptManager>
    <telerik:RadStyleSheetManager runat="server" ID="StyleSheetManager">
    </telerik:RadStyleSheetManager>
    <asp:Panel ID="panel1" runat="server" Width="100%" Height="100%" SkinID="Windows7">
        <telerik:RadSplitter LiveResize="false" ID="RadSplitter1" runat="server" Height="100%"
            Width="100%" Orientation="Horizontal" VisibleDuringInit="false">
            <telerik:RadPane ID="RadPane3" runat="server" Height="50px" Scrolling="none">
                <hd:Header runat="server" ID="header" />
            </telerik:RadPane>
            <telerik:RadPane ID="RadPane4" runat="server">
                <telerik:RadSplitter LiveResize="false" ID="ContentSplitter" runat="server">
                    <telerik:RadPane ID="paneMenu" runat="server" Width="220">
                        <telerik:RadSplitter LiveResize="false" runat="server" ID="NavigationsSplitter" Orientation="Horizontal">
                            <telerik:RadPane ID="RadPane1" runat="server" Scrolling="None" Height="26">
                                <telerik:RadTextBox ID="RadTextBox4" runat="server" Width="50" />
                                <telerik:RadButton runat="server" ID="btnNeu" Text="Filtern" CausesValidation="false">
                                    <Icon PrimaryIconCssClass="rbSearch" />
                                </telerik:RadButton>
                            </telerik:RadPane>
                            <telerik:RadPane runat="server" ID="TreeViewPane">
                                <ob:Objektbaum runat="server" ID="objektbaum" />
                            </telerik:RadPane>
                        </telerik:RadSplitter>
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" />
                    <telerik:RadPane ID="paneInhalt" runat="server" Scrolling="None">
                        <telerik:RadSplitter LiveResize="false" runat="server">
                            <telerik:RadPane runat="server" Scrolling="None">
                                <div class="breadcrumb_header">
                                    <asp:ContentPlaceHolder runat="server" ID="cpHeaderControls" />
                                    <bc:Breadcrumb runat="server" ID="breadcrumb" />
                                </div>
                                <telerik:RadSplitter LiveResize="false" runat="server">
                                    <telerik:RadPane runat="server" Scrolling="None">
                                        <telerik:RadSplitter LiveResize="false" runat="server" ID="srechts" Orientation="Horizontal">
                                            <telerik:RadPane ID="RadPane2" runat="server">
                                                <div id="content" class="div_content">
                                                    <asp:ContentPlaceHolder ID="cphHauptInhalt" runat="server">
                                                    </asp:ContentPlaceHolder>
                                                </div>
                                            </telerik:RadPane>
                                            <telerik:RadSplitBar runat="server" />
                                            <telerik:RadPane ID="paneErrorManagement" runat="server" Height="60" Scrolling="None">
                                                <cc1:EventViewer ID="EventViewer1" runat="server" EventClassPopupLevel="Error" VisualizeAllEventClassesThreshold="Success">
                                                </cc1:EventViewer>
                                            </telerik:RadPane>
                                        </telerik:RadSplitter>
                                    </telerik:RadPane>
                                </telerik:RadSplitter>
                            </telerik:RadPane>
                            <telerik:RadSplitBar ID="KontextSplitter" runat="server" Width="25" />
                            <telerik:RadPane runat="server" Width="25" Height="25" PersistScrollPosition="true">
                                <telerik:RadSlidingZone runat="server" ID="szrechts" Width="0" SlideDirection="Left">
                                    <telerik:RadSlidingPane runat="server" ID="sprechts" Width="200" PersistScrollPosition="true"
                                        Height="25" IconUrl="~/images/navigation/ico_kontext.png" Scrolling="None">
                                        <ko:Kontext runat="server" ID="kontext" />
                                    </telerik:RadSlidingPane>
                                </telerik:RadSlidingZone>
                            </telerik:RadPane>
                        </telerik:RadSplitter>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </asp:Panel>
    </form>
</body>

The performance with only static content for this page is excellent.

Now we place a RadGrid in main Content (cphHauptInhalt).

<asp:Content ID="Content2" ContentPlaceHolderID="cphHauptInhalt" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgResult">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgResult" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadGrid ID="rgResult" OnNeedDataSource="getDataSource" runat="server" AllowSorting="True">
        <PagerStyle Mode="NumericPages" />
        <MasterTableView TableLayout="Fixed" /> 
    </telerik:RadGrid>
</asp:Content>

The performance is now very very bad!

If the grid has only 100 items, it take about 4s to load, with 300 items it takes about 7s and with 700 items it takes 12s. Most of the time (round about 85%) the client works in javascript functions and the cpu is blocked with 100% load. Also if the mouse moves or the client window is resized.

I think, the performance is down because of the large DOM-Tree.

Is there a trick or anything to stop javascript calculating the whole DOM? Or is there another reason why it is so slow?
Kiranmayee
Top achievements
Rank 1
 answered on 06 Sep 2018
13 answers
1.4K+ views
Hi,
I have Footer row in my Radgrid with Text box as footer item template control for few columns. User can enter a value in text box and then click button to save it in database. I am not getting textbox value at runtime in button click event, its always ""

I am using the below code to read access footer value.
GridFooterItem footerItem = (GridFooterItem)gridBulkEdit.MasterTableView.GetItems(GridItemType.Footer)[0];                       
RadTextBox texte = (RadTextBox)footerItem.FindControl("txtPortfolioID");

please advise.
Marin Bratanov
Telerik team
 answered on 06 Sep 2018
10 answers
1.7K+ views
Currently, the RadComboBox displays a comma delimited list of checked items until all of the items are checked, at which point it displays "All items checked".  Would it be possible to get it to continue displaying the comma delimited list instead of that message when all of the items are checked?
Vessy
Telerik team
 answered on 06 Sep 2018
4 answers
453 views

I have a radgrid with Allow automaticupdates but when I try it it does update the database below is my asp.net code

<%@ Page Title="" Language="VB" MasterPageFile="~/Header.master" AutoEventWireup="false" CodeFile="InvoiceSchedule.aspx.vb" Inherits="StepIII_InvoiceSchedule" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>


  
   <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
        </Scripts>
      
    </telerik:RadScriptManager>

 

<div class="Invoice">

       <%-- Created a gridview that has templates --%>
         
          <asp:SqlDataSource ID="sqlMonth" runat="server" ConnectionString="<%$ ConnectionStrings:COSIGrantsDB %>" SelectCommand="SELECT * FROM [lkp_Month]"></asp:SqlDataSource>
          <asp:SqlDataSource ID="sqlYear" runat="server" ConnectionString="<%$ ConnectionStrings:COSIGrantsDB %>" SelectCommand="SELECT * FROM [lkp_Year]"></asp:SqlDataSource>
          <asp:SqlDataSource ID="sqlInvoiceSource" runat="server" ConnectionString="<%$ ConnectionStrings:COSIGrantsDB %>" SelectCommand="SELECT SourceID as SID, Source AS invoicesource FROM lkp_InvoiceSource"></asp:SqlDataSource>
          <asp:SqlDataSource runat="server" ID="sqlInvoice" ConnectionString='<%$ ConnectionStrings:COSIGrantsDB %>' SelectCommand="SELECT InvoiceSchedule_Test.Amount, lkp_Month.Month, InvoiceSchedule_Test.MonthId, InvoiceSchedule_Test.YearId, InvoiceSchedule_Test.SourceId, lkp_Year.Year, lkp_InvoiceSource.Source, InvoiceSchedule_Test.ApplicationID, InvoiceSchedule_Test.InvoiceScheduleId FROM InvoiceSchedule_Test LEFT OUTER JOIN lkp_Month ON InvoiceSchedule_Test.MonthId = lkp_Month.MonthID LEFT OUTER JOIN lkp_Year ON InvoiceSchedule_Test.YearId = lkp_Year.YearID LEFT OUTER JOIN lkp_InvoiceSource ON InvoiceSchedule_Test.SourceId = lkp_InvoiceSource.SourceID WHERE (InvoiceSchedule_Test.ApplicationID = @AppID)" InsertCommand="INSERT INTO InvoiceSchedule_Test(MonthId, YearId, Amount, SourceId, ApplicationID) VALUES (@monthid, @yearid, @amount, @sourceid, @appid)" DeleteCommand="Delete from InvoiceSchedule_test where invoicescheduleid=@invoiceid" UpdateCommand="UPDATE InvoiceSchedule_Test SET MonthId = @monthid, YearId = @yearid, Amount = @amount, SourceId = @sourceid, ApplicationID = @appid WHERE (InvoiceScheduleId = @invoiceschedid)">

              <DeleteParameters>
                  <asp:Parameter Name="invoiceid"></asp:Parameter>
              </DeleteParameters>
              <InsertParameters>
                  <asp:Parameter Name="monthid"></asp:Parameter>
                  <asp:Parameter Name="yearid"></asp:Parameter>
                  <asp:Parameter Name="amount"></asp:Parameter>
                  <asp:Parameter Name="sourceid"></asp:Parameter>
                  <asp:SessionParameter SessionField="appid" Name="AppID" Type="Int32"></asp:SessionParameter>
              </InsertParameters>
              <SelectParameters>
                  <asp:SessionParameter SessionField="appid" Name="AppID" Type="Int32"></asp:SessionParameter>
              </SelectParameters>
              <UpdateParameters>
                  <asp:Parameter Name="monthid"></asp:Parameter>
                  <asp:Parameter Name="yearid"></asp:Parameter>
                  <asp:Parameter Name="amount"></asp:Parameter>
                  <asp:Parameter Name="sourceid"></asp:Parameter>
                  <asp:SessionParameter SessionField="appid" Name="AppID" Type="Int32"></asp:SessionParameter>
           <asp:Parameter Name="invoiceschedid" />
                     </UpdateParameters>


          
          </asp:SqlDataSource>
          <telerik:RadGrid ID="rg" runat="server" AutoGenerateEditColumn="True" DataSourceID="sqlInvoice" AutoGenerateDeleteColumn="True" AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True">

<GroupingSettings CollapseAllTooltip="Collapse all groups"></GroupingSettings>

              <MasterTableView DataKeyNames="InvoiceScheduleId" DataSourceID="sqlInvoice" AutoGenerateColumns="False" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" CommandItemDisplay="top">
                  <Columns>
                      <telerik:GridBoundColumn DataField="Amount" HeaderText="Amount" SortExpression="Amount" UniqueName="Amount" DataType="System.Decimal" FilterControlAltText="Filter Amount column"></telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="Month" HeaderText="Month" SortExpression="Month" UniqueName="Month" FilterControlAltText="Filter Month column"></telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="MonthId" HeaderText="MonthId" SortExpression="MonthId" UniqueName="MonthId" DataType="System.Int32" FilterControlAltText="Filter MonthId column"></telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="YearId" HeaderText="YearId" SortExpression="YearId" UniqueName="YearId" FilterControlAltText="Filter YearId column" DataType="System.Int32"></telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="SourceId" HeaderText="SourceId" SortExpression="SourceId" UniqueName="SourceId" FilterControlAltText="Filter SourceId column"></telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="Year" HeaderText="Year" SortExpression="Year" UniqueName="Year" DataType="System.Int32" FilterControlAltText="Filter Year column"></telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="Source" FilterControlAltText="Filter Source column" HeaderText="Source" SortExpression="Source" UniqueName="Source">
                      </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="ApplicationID" DataType="System.Int32" FilterControlAltText="Filter ApplicationID column" HeaderText="ApplicationID" SortExpression="ApplicationID" UniqueName="ApplicationID">
                      </telerik:GridBoundColumn>
                      <telerik:GridBoundColumn DataField="InvoiceScheduleId" DataType="System.Int32" FilterControlAltText="Filter InvoiceScheduleId column" HeaderText="InvoiceScheduleId" ReadOnly="True" SortExpression="InvoiceScheduleId" UniqueName="InvoiceScheduleId">
                      </telerik:GridBoundColumn>
                  </Columns>
              </MasterTableView>
          </telerik:radgrid>
       <%--   <telerik:RadGrid ID="rg" runat="server" AutoGenerateDeleteColumn="True" allowautomaticdeletes="true" AutoGenerateEditColumn="True" DataSourceID="sqlInvoice" AllowAutomaticInserts="True" onUpdateCOmmand="rg_Update" AutoGenerateColumns="False" CellSpacing="-1" GridLines="Both" onDeleteCommand="rg_DeleteCommand"  >



            <MasterTableView DataKeyNames="InvoiceScheduleId" DataSourceID="sqlInvoice" commanditemdisplay="top" >
                   <Columns>
                         <telerik:GridBoundColumn HeaderText="invoiceid" datafield="invoicescheduleid"></telerik:GridBoundColumn>
                
                         <telerik:GridTemplateColumn DataField="source" FilterControlAltText="Filter Invoicesource column" HeaderText="source" UniqueName="Invoicesource">
                             <EditItemTemplate>
                                 <asp:DropDownList ID="sourceDropDownList" runat="server" DataSourceID="sqlInvoiceSource" DataTextField="invoicesource" DataValueField="sid">
                                 </asp:DropDownList>
                             </EditItemTemplate>
                             <ItemTemplate>
                                 <asp:Label ID="sourceLabel" runat="server" Text='<%# Eval("source") %>'></asp:Label>
                             </ItemTemplate>
                         </telerik:GridTemplateColumn>
          
                
                       <telerik:GridDropDownColumn DataField="monthid"   HeaderText="Month" uniquename="monthid" ListTextField="Month" ListValueField="monthid" datasourceid="sqlMonth"></telerik:GridDropDownColumn>
                       <telerik:griddropdowncolumn uniqueName="yearid" ListTextField="year" ListValueField="yearid" DataSourceID="sqlYear" HeaderText="Year" DataField="yearid"></telerik:griddropdowncolumn>
                       <telerik:gridboundcolumn UniqueName="amount" HeaderText="amount" Dataformatstring="{0:C}" DataField="amount"></telerik:gridboundcolumn>
                         
                     
            
                         
                     
                    
               
                   </Columns>
               </MasterTableView>
           </telerik:RadGrid>
       --%>
          
             </div>

 

Can anyone tell me what I am doing wrong?

Thanks

 

Robin 

Attila Antal
Telerik team
 answered on 05 Sep 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?