Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
138 views
Hi,

I am struggling a bit to get a progress area from being displayed in IE. Basically I am calling a WebMethod from the JavaScript and the WebMethod is updating the ProgressArea. Here is an example of my code:

Javascript:

function IsLongRunningTaskCompleted(){
            
            var lParams = GetPageMethodArguments();
            var lLocation = window.location.href;
            var lLocationToSubstringIndex = lLocation.search(".aspx?") + 5;
            lLocation = lLocation.substr(0, lLocationToSubstringIndex);
           
            $.ajax({
                type    : "POST",
                url     : lLocation + "/" + "ExecuteLongRunningTask",
                data    : "{" + lParams + "}",
                contentType : "application/json; charset=utf-8",
                dataType    : "json",
                success : function (pCurrentAction)
                            {
                                if (pCurrentAction.d == "Completed") CloseCurrentAspxPage();
                                window.setTimeout("IsLongRunningTaskCompleted()", 100);
                            },
                fail : function (pCurrentAction)
                            {
                                    CloseCurrentAspxPage();
                            }
                });
            }
        }

Server side :

public class DoStuff
{
        private static RadProgressContext FProgressArea;
        private static double FCurrentPrecentage ;

        protected void Page_Load(object sender, EventArgs e)
        {
             FProgressArea = RadProgressContext.Current;
             FCurrentPrecentage  = 0.0;
        }

        private delegate int ExecuteTimeConsumingProcessProcess();

        [WebMethod]
        public static string ExecuteLongRunningTask()
        {
           
            if (String.IsNullOrEmpty(FCurrentDuplicateStatus))
            {
                
                var lWriteInfoToDb = new WriteInfoToDB();
                var lSavingStuff = new ExecuteTimeConsumingProcessProcess(lWriteInfoToDb.SaveALotOfData);

                IAsyncResult lResult = lSavingStuff .BeginInvoke(null, null);

                while (!lResult.IsCompleted)
                {
                    FCurrentPrecentage = lSavingStuff.PercentageCompleted;
                    UpdateProgressBar(FProgressArea, FCurrentPrecentage );
                    Thread.Sleep(100);
                }

                lSavingStuff .EndInvoke(lResult);
                FCurrentStatus = "Completed";
            }

            return FCurrentStatus ;
        }

        private static void UpdateProgressBar(RadProgressContext pProgressArea, double pPercentageCompleted)
        {
            const int cTotal = 100;

            pProgressArea.Speed = "N/A";
            pProgressArea.PrimaryTotal = 1;
            pProgressArea.PrimaryValue = 1;
            pProgressArea.PrimaryPercent = 100;

            pProgressArea.SecondaryTotal = cTotal;
            pProgressArea.SecondaryPercent = pPercentageCompleted;
            pProgressArea.CurrentOperationText = "Step " + pPercentageCompleted;
            Thread.Sleep(100);
        }
}

In Firefox this is working perfectly well, but in IE I am not getting a progress area, and the page request times out. Have you got any idea what I am doing wrong by looking at the code? Or do you have any tips?

Thanks in advance.
Wayne Keet
Top achievements
Rank 1
 answered on 08 Oct 2010
1 answer
134 views

Hi,

I am trying to implement the Google style filtering for RadGrid (version 2010.1.519.20) in SharePoint 2007.
First I implemented the code for google style filtering as shown in the example on your site.

The code was working but refreshing using full postback instead of AJAX postback.
AJAX has a well known issue for causing full postback in SharePoint and is fixed with the following code

        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            EnsurePanelFix();

        }

        private void EnsurePanelFix()
        {
            ScriptManager.RegisterStartupScript
              (this,
               typeof(UpdatePanel),
               "UpdatePanelFixup",
               "_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;",
               true);
        }

Doing this fixed the AJAX postback for all controls but causes an issue with RadComboBox.
On the first load, before any AJAX postbacks are caused the combo box loads with the following tag

<INPUT style="DISPLAY: block" id=xxx class=xxx name=xxx autocomplete="off" jQuery1286221047445="5">

after I click an action like sort, the combobox no longer has the autocomplete and jQuery properties and looks like the following

<INPUT style="DISPLAY: block" id=xxx class=xxx name=xxx>

This makes it so the drop down box no longer appears. Does anyone know how to fix this?


Andy
Kamen Bundev
Telerik team
 answered on 08 Oct 2010
1 answer
147 views
Dear Telerik team,

We are using MCMS 2002 and Rad Control(6.3.3.0).
When we try to creat a page and then while saving this newly created page we are getting a javascript error 'Access Denied'. the template which is used to create this page uses Rad Controls. After fruther investigations we found that this error is raised from RadEditor.js (C:\Program Files\Microsoft Content Management Server\Server\IIS_CMS\RadControls\Editor\Scripts\6_6_3) file where in it tries to access ContentWindow object. The strange thing is this error occurs only when we run locally on server. When accessed from client browser (any) no such error is raised. We have enabled host header mapping in MCMS.

Sever is Windows 2000 server with IE 6 + SP1 installed on it.
Any suggestion or ideas on what could cause this issue?

Rumen
Telerik team
 answered on 08 Oct 2010
1 answer
84 views
Hi,
I have 3 RadComboboxes and 1 RadGird on my page.
If i select item from RadCombobox1, RadCombobox2 will be populates then if i select item from  RadCombobox2 then RadCombobox3 will be populates.
After i select item from RadCombobox3 then RadGrid will filled up.

I am using RadAjaxManger to avoid the whole page refresh when i select items from RadComboBoxes.
But the interesting thing is if i select Item from RadCombobox3, 
First      protected void RadComboBox1_SelectedIndexChanged event firing then coming to 
             protected void RadComboBox3_SelectedIndexChanged
        
I don't know way.

Here is my code
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox2" />                   
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadComboBox2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadComboBox3">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgdNoticeHistory" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
<telerik:RadComboBox ID="RadComboBox1" runat="server"  Width="200px"
            onselectedindexchanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="true">
        <Items>
                    <telerik:RadComboBoxItem runat="server" Text="ALL" Value="ALL" />
                    <telerik:RadComboBoxItem runat="server" Text="A" Value="A" />
                    <telerik:RadComboBoxItem runat="server" Text="B" Value="B" />
                    <telerik:RadComboBoxItem runat="server" Text="C" Value="C" />                   
        </Items>
        </telerik:RadComboBox>
     
    <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="200px"
            onselectedindexchanged="RadComboBox2_SelectedIndexChanged" AutoPostBack="true"></telerik:RadComboBox>
    
     <telerik:RadComboBox ID="RadComboBox3" runat="server" Width="200px"
            onselectedindexchanged="RadComboBox3_SelectedIndexChanged" AutoPostBack="true"></telerik:RadComboBox>

Here my code behind:

protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadComboBox2.Items.Clear();
            RadComboBox3.Items.Clear();
            LoadRadComboBox2Items();           
        }
 
protected void RadComboBox2_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadComboBox3.Items.Clear();
            LoadRadComboBox3Items();
        }
 
 protected void RadComboBox3_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
        {     
                RadGrid1.DataSource = GetAllData(Convert.ToInt32(RadComboBox1.SelectedValue.ToString()), Convert.ToInt32(RadComboBox3.SelectedValue.ToString()));
                RadGrid1.Rebind();             
        }


Please help me..
Kalina
Telerik team
 answered on 08 Oct 2010
1 answer
145 views
Hi

I have a radEditor with its toolbar mode set to "pageTop".  When the toolbar appears and disappears I want to run some custom javascript..

How do I access the toolbar show/hide events through javascript code ?

Also, I want to add my own custom toolbar button which when clicked will hide the toolbar.  Is this possible ?

Thanks
Rumen
Telerik team
 answered on 08 Oct 2010
4 answers
201 views
Hi I am really struggling to get my head around these tools using the supplied documentation.

I have what I think is a pretty common scenario. We have a tab strip with several dynamically loaded tabs, that use load on demand to fill in a page view. The page views all load a user webcontrol which contains a RadGrid. The RadGrid loads different data depending on the Category property assigned to teh user webcontrol.

Could someone please have a look at my code and tell me what I need to do to get the grid to work with the edit/update/cancel code in ajax? At the moment I think they are always posting back.

I have cut our code down to the bare essentials, it will not take long for Telerik to look. I have tried to read and understand the documentation on RadAjaxManager/RadProxyManager but do not know how I can set this to work properly sorry.

<!--test.aspx--> 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register assembly="RadTabStrip.Net2" namespace="Telerik.WebControls" tagprefix="radTS" %> 
<%@ Register TagPrefix="uc" TagName="UserControl1" Src="UserControl1.ascx"%> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Untitled Page</title> 
    <script type="text/javascript">  
    </script> 
</head> 
<body> 
    <form id="form1" runat="server">  
    <div> 
       
    <asp:ScriptManager ID="ScriptManager" runat="server" /> 
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1">  
        <asp:Image runat="server" ID="LoadingImage1" ImageUrl="~/Ajax/Img/loading7.gif" AlternateText="Loading..." /> 
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="RadMultiPage1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <script type="text/javascript">  
        function onTabSelecting(sender, args)  
        {     
            if (args.get_tab().get_pageViewID())  
            {args.get_tab().set_postBack(false);}  
        }  
    </script> 
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated">  
    </telerik:RadMultiPage> 
    <telerik:RadTabStrip OnClientTabSelecting="onTabSelecting" ID="RadTabStrip1" SelectedIndex="0" runat="server" MultiPageID="RadMultiPage1" Skin="Office2007" OnTabClick="RadTabStrip1_TabClick" Orientation="HorizontalBottom">  
    </telerik:RadTabStrip> 
    <span id="spnDebug" runat="server">  
    </span> 
    </div> 
    </form> 
</body> 
</html> 
 
 
<!--test.aspx.cs--> 
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
using Telerik.Web.UI;  
 
public partial class Test : System.Web.UI.Page  
{  
    protected void Page_Load(object sender, System.EventArgs e)  
    {  
        if (!Page.IsPostBack)  
        {  
              
            AddTab("Category 1");  
            AddTab("Category 2");  
            AddTab("Category 3");  
            if(RadTabStrip1.Tabs.Count > 0){AddPageView(RadTabStrip1.Tabs[0]);}  
              
        }  
    }  
 
    private void AddTab(string tabName)  
    {  
        RadTab tab = new RadTab();  
        tab.Text = tabName;  
        RadTabStrip1.Tabs.Add(tab);  
    }  
 
    protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)  
    {  
        string userControlName = "UserControl1.ascx";  
        test_UserControl1 userControl = (test_UserControl1) Page.LoadControl(userControlName);  
        userControl.ID = e.PageView.ID + "_userControl";  
        userControl.Category = e.PageView.ID;  
        e.PageView.Controls.Add(userControl);  
    }  
 
    private void AddPageView(RadTab tab)  
    {  
        RadPageView pageView = new RadPageView();  
        pageView.ID = tab.Text;  
        RadMultiPage1.PageViews.Add(pageView);  
        tab.PageViewID = pageView.ID;  
    }  
 
    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)  
    {  
        AddPageView(e.Tab);  
        e.Tab.PageView.Selected = true;  
    }  
      
      
}  
 
<!--User Control 1--> 
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserControl1.ascx.cs" Inherits="test_UserControl1" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="Horizontal" AutoGenerateEditColumn="true" Skin="WebBlue" OnUpdateCommand="RadGrid1_UpdateCommand" OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="RadGrid1_NeedDataSource">  
    <MasterTableView AutoGenerateColumns="True" EditMode="InPlace" TableLayout="Auto">  
        <RowIndicatorColumn Visible="False">  
            <HeaderStyle Width="20px"></HeaderStyle> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn Visible="False" Resizable="False">  
            <HeaderStyle Width="20px"></HeaderStyle> 
        </ExpandCollapseColumn> 
        <Columns> 
        </Columns> 
        <EditFormSettings> 
            <PopUpSettings ScrollBars="None"></PopUpSettings> 
        </EditFormSettings> 
    </MasterTableView> 
</telerik:RadGrid> 
<span id="spnDebug" runat="server"/>  
 
<!--UserControl1.ascx.cs--> 
using System;  
using System.Collections;  
using System.Configuration;  
using System.Data;  
using System.Linq;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.HtmlControls;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Linq;  
 
using Telerik.Web.UI;  
 
public partial class test_UserControl1 : System.Web.UI.UserControl  
{  
    public string Category{get;set;}  
    protected void Page_Load(object sender, EventArgs e)  
    {  
        spnDebug.InnerHtml = "UC loaded at " + DateTime.Now.ToString() + "<br/>Category is " + Category + "<br/>";  
    }  
      
      
    protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
    {  
        ArrayList list = new ArrayList();  
        switch (Category)  
        {  
            case "Category 1":  
                list.Add("Cat1 Thing 1");  
                list.Add("Cat1 Thing 2");  
                list.Add("Cat1 Thing 3");  
                break;  
            case "Category 2":  
                list.Add("Cat2 Thing 1");  
                list.Add("Cat2 Thing 2");  
                list.Add("Cat2 Thing 3");  
                break;  
            case "Category 3":  
                list.Add("Cat3 Thing 1");  
                list.Add("Cat3 Thing 2");  
                list.Add("Cat3 Thing 3");  
                break;  
            default:  
                list.Add("Cat Unknown Thing 1");  
                break;  
        }  
        RadGrid1.DataSource = list;  
          
    }  
 
    protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)  
    {  
        spnDebug.InnerHtml += "RadGrid1_UpdateCommand Called<br/>";  
    }  
 
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
    {  
        spnDebug.InnerHtml += "RadGrid1_ItemDataBound Called<br/>";  
    }  
      
}  
 
Maria Ilieva
Telerik team
 answered on 08 Oct 2010
1 answer
94 views

I have a webpage that has a RadGrid on it (among other controls) and display a modal window when the user submits data. If the rows on the grid are less than 100 rows it all works fine. But if the row count is greater than 100 (or somewhere around 100, haven't got it to an exact figure) the parent webpage's control etc. all disappear and only once the modal window is closed does the parent window redisplay correctly.
Any ideas?

I am using the following javascript to display the window:

 

function OpenValidationWindow() {
    oWnd = window.radopen('../MarketDataPriceInputValidation.aspx', null);
    oWnd.show();
    oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close);
    oWnd.SetSize(625, 600);
    //Adjust position of validation window
    oWnd.MoveTo(162.5, 110);
    //Set the callBack function to be called once the user has clicked on a button on the validation window
    oWnd.add_close(OnValidationWindowClose);
}

 

 

Georgi Tunev
Telerik team
 answered on 08 Oct 2010
1 answer
130 views
Dear Telerik Team,

I add during the page cycle (page_load event) templates for the alert and confirm dialog. This works good and I can use my own templates.

But how can I set the width and height properties for this windows? I try it by looking into the windowsCollection in debug time, but this templates aren't a part of it. If I try to set the first div in my templates to a width for example 600px the design of window corners/boarders are broken.

Thanks for your help.

Kind regards
Christian
Georgi Tunev
Telerik team
 answered on 08 Oct 2010
2 answers
85 views
Hello all,

I have RAD window in which i have form where i allow users to enter information, on that form i have 2 buttons "Save" and "Save & Add Another".

On the "Save & Add Another" i want to refresh the parent screen to refresh and grid and show the added information. I dont want to close the current RADwindow because user can add one more item. but in mean time i want parent screen to be refreshed with latest information thats been added.

let me know how i can do that.

Thanks in advance.
Georgi Tunev
Telerik team
 answered on 08 Oct 2010
1 answer
79 views
Hello,

I have a screen with number of opened radwindows. All winodws have the same TopLeft coordinate, whenever I minimize them, the mininized windows stack up into one "pile". Is there a way to separated the minimized windows ?

To reproduce :

http://demos.telerik.com/aspnet-ajax/window/examples/restrictionzone/defaultcs.aspx

try opening two windows at same location and minimize them.

10x.
Georgi Tunev
Telerik team
 answered on 08 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?