Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
246 views
Hi,

I have a grid on one of my pages that take a long time to load. The first page load shows a blank screen till the time the grid is loaded. I need to show a loading panel while the grid is loading on the initial page load.

I have master content pages in my app and the RadAjaxManager resides on the master page.

I tried to follow the examples here:
http://www.telerik.com/help/aspnet-ajax/ajxshowloadingpaneloninitialpageload.html
http://www.telerik.com/help/aspnet-ajax/ajax-manager-proxy.html

However, my manager_AjaxRequest never seems to fire.

Below is my aspx code. A working sample will be appreciated.
<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="Calendar.aspx.cs" Inherits="Calendar"  %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderContent" runat="Server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <telerik:RadAjaxManagerProxy ID="RadAJAXManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBoxCalendarFor">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadComboBoxCalendarFor" />
                    <telerik:AjaxUpdatedControl ControlID="dummyTextBox" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGridCalendar" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
        <script type="text/javascript">
             
            function GridCreated(sender, args) {
                var scrollArea = sender.GridDataDiv;
                var dataHeight = sender.get_masterTableView().get_element().clientHeight;
                if (dataHeight < 350) {
                    scrollArea.style.height = dataHeight + 17 + "px";
                }
  
                sender.get_masterTableView().hideFilterItem();
            }            
  
            function pageLoad(sender, eventArgs) {
                if (!eventArgs.get_isPartialLoad()) {
                    $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("InitialPageLoad");
                }
            
  
        </script>
  
    </telerik:RadCodeBlock>
    <asp:Panel ID="Panel1" runat="server">
        <asp:Panel ID="Panel2" Visible="false"  runat="server">
            <div style="width: 100%; text-align: center;">
                <table border="0" cellspacing="0" class="calendar" >
                    <tr>
                        <th colspan="8" class="calendar" >
                            <table>
                                <tr>
                                    <td style="color: #000000; font-size: 10pt">
                                        User Calendar  
                                    </td>
                                    <td>
                                        <telerik:RadComboBox runat="server" ID="RadComboBoxCalendarFor" Width="175px" OnPreRender="RadComboBoxCalendarFor_PreRender"
                                            OnSelectedIndexChanged="RadComboBoxCalendarFor_SelectedIndexChanged" AllowCustomText="true"
                                            AutoPostBack="true" HighlightTemplatedItems="true">
                                        </telerik:RadComboBox>
                                    </td>
                                </tr>
                            </table>
                        </th>
                    </tr>
                      
                    <tr>
                        <td colspan="8" >
                            <telerik:RadGrid ID="RadGridCalendar" runat="server" GridLines="None" AllowPaging="true"
                                PageSize="20" AllowFilteringByColumn="true" Width="975px" ShowHeader="true" OnColumnCreated="RadGridCalendar_ColumnCreated"
                                OnItemCreated="RadGridCalendar_ItemCreated" OnItemDataBound="RadGridCalendar_ItemDataBound"
                                OnPreRender="RadGridCalendar_PreRender" AutoGenerateColumns="False" EnableLinqExpressions="false"
                                ShowGroupPanel="false" OnItemCommand="RadGridCalendar_ItemCommand" AllowSorting="true"
                                AllowCustomPaging="false" OnNeedDataSource="RadGridCalendar_NeedDataSource">
                                <ClientSettings Resizing-AllowColumnResize="true">
                                    <ClientEvents OnGridCreated="GridCreated" />
                                    <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="450px" />
                                </ClientSettings>
                                <ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="false"
                                    FileName="CalendarExport">
                                    <Pdf AllowAdd="false" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous"
                                        Keywords="None" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in"
                                        PageWidth="297mm" PageHeight="210mm" PageTopMargin="1in" PageTitle="Calendar"
                                        Subject="Calendar Export" Title="Calendar" />
                                </ExportSettings>
                                <MasterTableView TableLayout="Fixed" HierarchyDefaultExpanded="true" ClientDataKeyNames="ActivityID"
                                    Width="100%" CommandItemDisplay="Top" DataKeyNames="ActivityID">
                                    <GroupByExpressions>
                                         
                                        <telerik:GridGroupByExpression>
                                            <SelectFields>
                                                <telerik:GridGroupByField FieldName="ActivityDate"></telerik:GridGroupByField>
                                            </SelectFields>
                                            <GroupByFields>
                                                <telerik:GridGroupByField FieldName="Date" FormatString="{0:d}" SortOrder="Descending">
                                                </telerik:GridGroupByField>
                                                <telerik:GridGroupByField FieldName="ActivityDate" FormatString="{0:d}" SortOrder="None">
                                                </telerik:GridGroupByField>
                                            </GroupByFields>
                                        </telerik:GridGroupByExpression>
                                    </GroupByExpressions>
                                    <Columns>
                                        <telerik:GridTemplateColumn UniqueName="TempColumn" HeaderText="">
                                            <ItemStyle Width="125px" BorderStyle="None"></ItemStyle>
                                            <HeaderStyle Width="125px" BorderStyle="None" />
                                            <ItemTemplate>
                                                <div>
                                                </div>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="TimeColumn" HeaderText="Time">
                                            <ItemStyle Width="125px" BorderStyle="None"></ItemStyle>
                                            <HeaderStyle Width="125px" HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <div>
                                                    <%# DataBinder.Eval(Container.DataItem, "StartTime") %>
                                                    <asp:Label ID="Label1" runat="server">-</asp:Label>
                                                    <%# DataBinder.Eval(Container.DataItem, "EndTime") %>
                                                </div>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                         
                                        <telerik:GridTemplateColumn UniqueName="DueDate" HeaderText="Due Date" Visible="false">
                                            <ItemStyle BorderStyle="None"></ItemStyle>
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <div>
                                                    <%# Eval("DueDate")%>
                                                </div>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                         
                                                                             <telerik:GridTemplateColumn UniqueName="Company" HeaderText="Company">
                                            <ItemStyle BorderStyle="None"></ItemStyle>
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <div>
                                                    <%# Eval("Employer")%>
                                                </div>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>                                       
                                    </Columns>
                                    <HeaderStyle Width="125px" />
                                    <CommandItemTemplate>
                                        <asp:ImageButton ID="ImageButtonAdd" runat="server" ImageUrl="~/App_Themes/Layout/plus-icon.png"
                                            AlternateText="Add" PostBackUrl=""/> 
                                                                           </CommandItemTemplate>
                                    <PagerStyle Position="TopAndBottom" PrevPageText="Prev" NextPageText="Next" Mode="NextPrev" />
                                </MasterTableView>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="8" align="center">
                            <br />
                               
                            <asp:Button ID="btnCancel" runat="server" OnClientClick="location.href='../Lookup.aspx';return false;"
                                Text="Cancel" />
                            <asp:TextBox ID="dummyTextBox" BorderColor="White" BorderStyle="None" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </div>
        </asp:Panel>
    </asp:Panel>
</asp:Content>
Maria Ilieva
Telerik team
 answered on 12 Jul 2010
1 answer
68 views
I have a RadColorCombo Picker (Doesnt matter WHAT rad object i use)
and it is updating a RadMenu (also doesnt matter what I update)
I set up ajax manager to update radmenu when colorcombopicker is used.
I get an error as follows:
Microsoft JScript runtime error: Object doesn't support this property or method
Section of code from Telerik.Web.UI.WebResource2_axd is the source  that has the error and the code it highlights is

if

 

 

(f.show(e)){var n={Panel:f,ControlID:e};

 

 

 

if(!Array.contains(this._loadingPanelsToHide,n)){this._loadingPanelsToHide[this._loadingPanelsToHide.length]=n;

 

 

}}}}}}},_initializeRequest:

 

function(e,c){Telerik.Web.UI.RadAjaxManager.callBaseMethod(this,"_initializeRequest",[e,c]);

 

if

 

(!this._isRequestInProgress){return;

}

 

var a=c.get_postBackElement();

if
(f.show(e)) is highlighted in the debugger


As an example here is the aspx

 

<telerik:RadColorPicker ID="RadColorPicker1" Runat="server" AutoPostBack="True"

 

 

oncolorchanged="RadColorPicker1_ColorChanged" ShowIcon="True"

 

 

 

SelectedColor="" style="z-index: 4000;" Height="21px">

 

 

 

 

</telerik:RadColorPicker>

 

<

 

 

telerik:RadMenu ID="RadMenu1" Runat="server">

 

 

<Items>

 

 

<telerik:RadMenuItem runat="server" Text="1">

 

</telerik:RadMenuItem>

 

<telerik:RadMenuItem runat="server" Text="2">

 

 

</telerik:RadMenuItem>

 

 

</Items>

 

 

 

 

</telerik:RadMenu>

 

<telerik:RadAjaxManager runat="server"

 

onajaxrequest="RadAjaxManager1_AjaxRequest">

 

 

<AjaxSettings>

 

<telerik:AjaxSetting AjaxControlID="RadColorPicker1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadMenu1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 

 

Maria Ilieva
Telerik team
 answered on 12 Jul 2010
1 answer
115 views
Hello Telerik Team,

I have discovered a scenario that I believe is not by design.

Problem:

When using a table in a RadGrid GridTemplateColumn, the <td> tags render with a bottom border. This behavior appears similar to that when a browser renders 'default' borders for a table that has not specified otherwise. The exception, in the scenario mentioned this occurs only for the bottom border of the cells and only occurs in alternating rows.

Reproducing should be as simple as adding any table to a GridTemplateColumn and setting alternating row color to white (for visibility).

Solution:

CSS class to explicitly define cell borders with !important declaration(s) to override RadGrid style sheet.

Thanks,
Jeremy

Martin
Telerik team
 answered on 12 Jul 2010
1 answer
49 views
Hello,

I have a radTreeView control where the "+" and "-" are showing but the click event to expand and contract are disabled.

THanks
Thomas
Nikolay Tsenkov
Telerik team
 answered on 12 Jul 2010
1 answer
188 views
I am using RadTreeView with an ObjectDataSource containing objects that require different user controls that will fire change events be added to the RadTreeNode.Controls on OnDataBound.  The node controls collection does not appear to be included in the viewstate, and if not re-added on every postback the viewstate matching error occurs.  If the controls are recreated on a change postback, the originating control event does not fire.  Is there a set way to preserve the node controls to keep the viewstate happy and guarantee the firing of change events?  These user controls contain simple labels, dropdowns and text boxes etc.
Thanks.
Nikolay Tsenkov
Telerik team
 answered on 12 Jul 2010
0 answers
66 views
Hellow,

can someone explain to me how I can use this control to upload and then send the file as an attachment to an email address?
I also would like to check first if the user as uploaded a file and else show an error.

I hope you can help me with this.

Thanks in advance
J.
Joris
Top achievements
Rank 1
 asked on 12 Jul 2010
3 answers
198 views
Hi guys,
I'm making a simple page where a user has a radtextbox which is initially disabled. When a user clicks 'edit', the textbox is enabled, and can change the values. They can then hit 'save' to ideally change the value, but it doesn't seem to persist when clicked. It always remembers the old value. Say I had something to edit and the text said 'Here is the default text'. I would click edit, then when the radtextbox became enabled, I would add to it to have it say 'Here is the default text, plus more!'. Whenever I click 'save' though, the ajax panel that they are all in reloads, but has the same old text. I try to take the .text value from the radtextbox and it is always the old value. I realize that the server only knows the old value but I am completely unsure of how to get the text from the client side. Any help?
Thanks,
Cody
Maria Ilieva
Telerik team
 answered on 12 Jul 2010
1 answer
128 views
Hi all,

I have a Radgrid with some values and an aggregate function that calculates the average.
The values in the grid are editable clientside; at the end of the operation there is a button to confirm the data and save them to the server.
I would like to know whether there is the possibility to calculate the values of the aggregate function (Average) before saving the data to the server.

Thanks in advance for the answer.

Kind regards,

Dario Zanelli
Tsvetoslav
Telerik team
 answered on 12 Jul 2010
2 answers
166 views
I want to disable the edit command for rows that have a specific value in say the third column.  The code below seems to disable the whole edit column if the "if statement" is met jsut once.

Thanks
Doug

protected void teamGrid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = e.Item as GridDataItem;
  
                string firstName = dataItem["Firstname"].Text;
                string lastName = dataItem["Lastname"].Text;
  
                LinkButton button = dataItem["DeleteColumn"].Controls[0] as LinkButton;
                button.Attributes["onclick"] = "return confirm('Are you sure you want to deactivate " + firstName + " " + lastName + "?')";
  
  
                if (dataItem["EndDate"].Text != "")
                {
                    LinkButton linkButton = (LinkButton)dataItem["EditCommandColumn"].Controls[0];
                    linkButton.Enabled = false;
  
                    dataItem["EndDate"].Font.Strikeout = true;
                }
            }
        }
 
Douglas Hale
Top achievements
Rank 1
 answered on 12 Jul 2010
1 answer
209 views
I'd like to assign a unique id to each tab within the tabstrip but it appears this is a read only attribute.  I'm using my own css and I'd like to assign a dynamic css class to each tab depending on a number of variables.

Utilizing the FindTabByValue doesn't won't work for what I'm trying to do since I need to assign a new css background based on the id of the entire tab, not just the anchor or span tag within that tab. 

Has anyone been able to do this?
Peter
Telerik team
 answered on 12 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
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
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?