Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
135 views
Each Tab Controls inside the grid view takes 20 seconds to load

Please look the below code and let me know how to increase the performance. I have tried ajax to load each tab while onclick still it takes 20 sec to load each tab.


<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ManageLineItems.aspx.cs" Inherits="Crowley.Pricing.Web.LineItems.ManageLineItems"
    EnableEventValidation="false" %>

<%@ Register Src="PricingTabControl.ascx" TagName="PricingTabControl" TagPrefix="uc1" %>
<%@ Register Src="ContactTabControl.ascx" TagName="ContactTabControl" TagPrefix="uc2" %>
<%@ Register Src="CargoTabControl.ascx" TagName="CargoTabControl" TagPrefix="uc3" %>
<%@ Register Src="WarehousingTabControl.ascx" TagName="WarehousingTabControl" TagPrefix="uc4" %>
<%@ Register Src="DomesticTruckingTabControl.ascx" TagName="DomesticTruckingTabControl"
    TagPrefix="uc5" %>
<%@ Register Src="CustomsClearanceTabControl.ascx" TagName="CustomsClearanceTabControl"
    TagPrefix="uc6" %>
<%@ Register Src="AirFreightTabControl.ascx" TagName="AirFreightTabControl" TagPrefix="uc7" %>
<%@ Register Src="HistoryTabControl.ascx" TagName="HistoryTabControl" TagPrefix="uc8" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .viewWrap
        {
            padding: 15px;
            background: #2291b5 0 0 url(../App_Themes/Default/Images/bluegradient.gif) repeat-x;
        }
    </style>
    <telerik:RadScriptBlock runat="server">
        <script type="text/javascript">

            var loadedTabs = new Array("PricingTab");
            function onTabSelecting(sender, args) {
                var value = args.get_tab().get_value();

                for (var i = 0; i < loadedTabs.length; i++) {
                    if (loadedTabs[i] == value) {
                        args.get_tab().set_postBack(false);
                        return;
                    }
                }
                loadedTabs.push(value);

            }
        </script>
    </telerik:RadScriptBlock>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TitleContent" runat="server">
    Pricing : Manage Line Items
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <telerik:RadAjaxManagerProxy ID="uxAjaxManager" runat="server" >
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="uxLineItems">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="uxLineItems" LoadingPanelID="uxAjaxLoadingPanel" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
    <div style="overflow-x: auto; overflow-y: Auto; width: 100%; height: 335px; padding: 0 0 20px 0">
        <telerik:RadGrid AllowSorting="true" Width="2700px" ID="uxLineItems" runat="server"
            AllowFilteringByColumn="true" AutoGenerateColumns="false" OnItemCommand="uxLineItems_ItemCommand"
            OnItemCreated="uxLineItems_ItemCreated" OnItemDataBound="uxLineItems_ItemDataBound"
            OnExcelMLExportRowCreated="uxLineItems_ExcelMLExportRowCreated" OnExcelMLExportStylesCreated="uxLineItems_ExcelMLExportStylesCreated">
            <MasterTableView DataKeyNames="ID, Request.ID" GroupLoadMode="Client" CommandItemDisplay="None"
                UseAllDataFields="true">
                <%--<ItemTemplate>
                <table cellspacing="10">
                    <tr>
                        <td><b>Request ID:</b></td>
                        <td><%# Eval("Request.ID") %></td>-
                    </tr>                
                </table>
            </ItemTemplate>--%>
                <%--  <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField FieldAlias="Request.RequestID" FieldName="Request.RequestID"></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="Request.RequestID"></telerik:GridGroupByField>
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>--%>
                <Columns>
                    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
                    <telerik:GridBoundColumn DataField="Request.RequestID" AllowFiltering="true" SortExpression="Request.RequestID"
                        UniqueName="RequestID" HeaderText="Request ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LineItemID" AllowFiltering="True" AllowSorting="false"
                        HeaderText="Line Item" />
                    <telerik:GridBoundColumn DataField="Request.Owner" SortExpression="Request.Owner"
                        UniqueName="Owner" AllowFiltering="true" HeaderText="Owner" ColumnEditorID="EditOwner" />
                    <%--<telerik:GridDropDownColumn AllowSorting="true" AllowFiltering="true" HeaderText="Quote Type" UniqueName="QuoteType"
                                            DataSourceID="QuoteTypeDataSource" DataField="QuoteType.ID" ListTextField="Name" ListValueField="ID" />--%>
                    <telerik:GridTemplateColumn DataField="QuoteType.ID" AllowFiltering="true" HeaderText="Quote Type"
                        UniqueName="QuoteType" SortExpression="QuoteType.ID">
                        <ItemTemplate>
                            <telerik:RadComboBox ID="uxQuoteTypes" runat="server" Width="100px" />
                            <asp:HiddenField ID="uxOriginalQuoteType" runat="server" Value='<%#Eval("QuoteType.ID") %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridDateTimeColumn DataField="Request.ReceivedOn" AllowFiltering="false"
                        UniqueName="ReceivedOn" SortExpression="Request.ReceivedOn" HeaderText="Date Received"
                        ItemStyle-Width="120px" />
                    <telerik:GridBoundColumn DataField="Request.CommodityDetails.Commodity.Name" AllowFiltering="true"
                        HeaderText="Commodity" UniqueName="Commodity" SortExpression="Request.CommodityDetails.Commodity.Name" />
                    <telerik:GridTemplateColumn AllowFiltering="true" HeaderText="Assigned To" UniqueName="AssignedTo">
                        <ItemTemplate>
                            <telerik:RadComboBox ID="uxAssignedTo" runat="server" Width="100px"
                             SelectedValue='<%# Eval("AssignedTo") %>'
                                DataSource='<%# Crowley.Pricing.Web.MetadataRepository.GetUsers() %>'
                            >
                            </telerik:RadComboBox>
                            <asp:HiddenField ID="uxOriginalAssignedTo" runat="server" Value='<%#Eval("AssignedTo") %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn DataField="Status.ID" SortExpression="Status.ID" HeaderText="Status"
                        UniqueName="Status">
                        <ItemTemplate>
                            <telerik:RadComboBox ID="uxStatus" runat="server" Width="150px" SelectedValue='<%# Eval("Status.ID") %>'
                                DataSource='<%# Crowley.Pricing.Web.MetadataRepository.GetStatus() %>' DataTextField="Name"
                                DataValueField="ID" />
                            <asp:HiddenField ID="uxOriginalStatus" runat="server" Value='<%#Eval("Status.ID") %>' />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="RoutingDetails.Origin.Location" UniqueName="Origin"
                        AllowSorting="false" AllowFiltering="true" HeaderText="Origin" ItemStyle-Width="135">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RoutingDetails.Origin.Type.Name" AllowSorting="false"
                        AllowFiltering="true" UniqueName="OriginService" HeaderText="Origin Service"
                        ItemStyle-Width="135" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Origin.ZipCode" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Origin Postal Code" UniqueName="OriginPostalCode"
                        ItemStyle-Width="70" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Origin.Port.Name" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Port of Load" UniqueName="PortofLoad" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Origin.Mode" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Origin Mode" UniqueName="OriginMod" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Origin.Load" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Origin Unload" UniqueName="OriginUnload" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Destination.Location" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Destination" UniqueName="Destination" ItemStyle-Width="135" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Destination.Type.Name" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Destination Service" UniqueName="DestinationService"
                        ItemStyle-Width="135" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Destination.ZipCode" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Destination Postal Code" UniqueName="DestinationPostalCode"
                        ItemStyle-Width="70" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Destination.Port.Name" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Port of Discharge" UniqueName="PortofDischarge" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Destination.Mode" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Dest Mode" UniqueName="DestMode" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.Destination.Load" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Dest Unload" UniqueName="DestUnload" />
                    <telerik:GridBoundColumn DataField="EquipmentSize" SortExpression="EquipmentSize"
                        AllowFiltering="true" HeaderText="Equipment Size" UniqueName="EquipmentSize" />
                    <telerik:GridBoundColumn DataField="EquipmentType" SortExpression="EquipmentType"
                        AllowFiltering="true" HeaderText="Equipment Type" UniqueName="EquipmentType" />
                    <telerik:GridBoundColumn DataField="Request.CommodityDetails.OtherIfNotCommodity"
                        AllowSorting="false" AllowFiltering="true" HeaderText="Equipment Desc (If Other)"
                        UniqueName="EquipmentDesc" />
                    <telerik:GridBoundColumn DataField="Request.CommodityDetails.UNNumbers" AllowSorting="false"
                        AllowFiltering="true" HeaderText="UN Numbers" UniqueName="UNNumbers" ItemStyle-Width="120" />
                    <telerik:GridBoundColumn DataField="Request.CommodityDetails.HazardousClass.Name"
                        AllowSorting="false" AllowFiltering="true" HeaderText="Class" UniqueName="ClassDescription"
                        ItemStyle-Width="150" />
                    <telerik:GridBoundColumn DataField="Request.CommodityDetails.HazardousPackagingGroup.Name"
                        AllowSorting="false" AllowFiltering="true" HeaderText="Packaging Group" UniqueName="PackagingGroup" />
                    <telerik:GridBoundColumn DataField="RoutingDetails.EstimatedWeight" AllowSorting="false"
                        AllowFiltering="true" HeaderText="Est Weight" UniqueName="EstWeight" />
                    <telerik:GridBoundColumn DataField="Request.CommodityDetails.SpecialRequirements"
                        AllowSorting="false" AllowFiltering="true" HeaderText="Special Requirements"
                        UniqueName="SpecialRequirement" />
                    <telerik:GridBoundColumn Display="true" DataField="PricingDetails.WarehousingServicesCharge"
                        UniqueName="WarehousingServicesCharge" SortExpression="PricingDetails.WarehousingServicesCharge"
                        HeaderText="Warehousing Services Total" />
                    <telerik:GridBoundColumn Display="true" DataField="PricingDetails.DomesticTruckingCharge"
                        UniqueName="DomesticTruckingCharge" SortExpression="PricingDetails.DomesticTruckingCharge"
                        HeaderText="Domestic Trucking Total" />
                    <telerik:GridBoundColumn Display="true" DataField="PricingDetails.CustomClearanceCharge"
                        UniqueName="CustomClearanceCharge" SortExpression="PricingDetails.CustomClearanceCharge"
                        HeaderText="Customs Clearance Total" />
                    <telerik:GridBoundColumn Display="true" DataField="PricingDetails.AirFreightCharge"
                        UniqueName="AirFreightCharge" SortExpression="PricingDetails.AirFreightCharge"
                        HeaderText="Air Freight Total" />
                    <telerik:GridBoundColumn Display="true" DataField="PricingDetails.CargoDetailsCharge"
                        UniqueName="CargoDetailsCharge" SortExpression="PricingDetails.CargoDetailsCharge"
                        HeaderText="Cargo Total" />
                    <telerik:GridBoundColumn Display="true" DataField="PricingDetails.OceanTotal" UniqueName="OceanTotal"
                        SortExpression="PricingDetails.OceanTotal" HeaderText="Ocean Total" />
                    <telerik:GridBoundColumn Display="true" DataField="PricingDetails.AdditionalFeesTotal"
                        UniqueName="AdditionalFeesTotal" SortExpression="PricingDetails.AdditionalFeesTotal"
                        HeaderText="Additional Fees Total" />
                    <telerik:GridBoundColumn DataField="PricingDetails.GrandTotal" UniqueName="GrandTotal"
                        SortExpression="PricingDetails.GrandTotal" HeaderText="Grand Total" />
                </Columns>
                <NestedViewTemplate>
             <telerik:RadAjaxManagerProxy runat="server" ID="uxAjaxManager">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="uxRadStripLineItems">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="uxRadStripLineItems" />
                        <telerik:AjaxUpdatedControl ControlID="uxMultiPageLineItems" LoadingPanelID="uxAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="uxMultiPageLineItems">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="uxMultiPageLineItems" LoadingPanelID="uxAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManagerProxy>
                    <div style="margin-left: 25px;" class="viewWrap">
                        <%--<asp:Panel ID="uxLineItemSectionContainer" runat="server">--%>
                        <telerik:RadTabStrip ID="uxRadStripLineItems" runat="server" Skin="Default" MultiPageID="uxMultiPageLineItems"
                            SelectedIndex="0" CssClass="tabStrip" OnClientTabSelecting="onTabSelecting" OnTabClick="uxRadStripLineItems_TabClick">
                            <Tabs>
                                <telerik:RadTab Text="Quote" Value="PricingTab" />
                                <telerik:RadTab Text="Contacts" Value="ContactTab" />
                                <telerik:RadTab Text="Cargo Details" Value="CargoTab" />
                                <telerik:RadTab Text="Warehousing" Value="WarehousingTab" />
                                <telerik:RadTab Text="Domestic Trucking" Value="DomesticTruckingTab" />
                                <telerik:RadTab Text="Customs Clearance / Freight Forwarding" Value="CustomsClearanceTab" />
                                <telerik:RadTab Text="Air Freight" Value="AirFreightTab" />
                                <telerik:RadTab Text="History" Value="HistoryTab" />
                            </Tabs>
                        </telerik:RadTabStrip>
                        <telerik:RadMultiPage ID="uxMultiPageLineItems" runat="server" SelectedIndex="0"
                            CssClass="multiPage" OnPageViewCreated="uxMultiPageLineItems_PageViewCreated">
                            <telerik:RadPageView ID="PricingTabView" runat="server">
                                <uc1:PricingTabControl ID="uxPricingTabControl" runat="server" />
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView2" runat="server">
                                <uc2:ContactTabControl ID="uxContactTabControl" runat="server" />
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView3" runat="server">
                                <uc3:CargoTabControl ID="uxCargoTabControl" runat="server" />
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView4" runat="server">
                                <uc4:WarehousingTabControl ID="uxWarehousingTabControl" runat="server" />
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView5" runat="server">
                                <uc5:DomesticTruckingTabControl ID="uxDomesticTruckingTabControl" runat="server" />
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView6" runat="server">
                                <uc6:CustomsClearanceTabControl ID="uxCustomsClearanceTabControl" runat="server" />
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView7" runat="server">
                                <uc7:AirFreightTabControl ID="uxAirFreightTabControl" runat="server" />
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="RadPageView8" runat="server">
                                <uc8:HistoryTabControl ID="uxHistoryTabControl" runat="server" />
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                        <%--</asp:Panel>--%>
                    </div>
                </NestedViewTemplate>
            </MasterTableView>
            <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
                <Excel Format="ExcelML" />
            </ExportSettings>
            <ClientSettings EnableRowHoverStyle="true" AllowGroupExpandCollapse="True">
                <Scrolling AllowScroll="False" UseStaticHeaders="False" SaveScrollPosition="True">
                </Scrolling>
                <%--  <DataBinding SelectMethod="GetLineItems" Location="http://localhost:6973/PricingService.svc"
                   SortParameterType="String" FilterParameterType="String">
               </DataBinding>--%>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
        </telerik:RadGrid>
        <%--<asp:Panel ID="uxLineItemSectionContainer" runat="server">--%>
    </div>



    <br clear="all" />
    <div style="width: 100%">
        <asp:Button class="normalbutton" ID="uxSave" runat="server" Text="Submit" OnClick="uxSave_Click" />&nbsp;&nbsp;
        <asp:Button class="button2" ID="uxAddLineItem" runat="server" Text="Add Line Item"
            OnClick="uxAddLineItem_Click" />&nbsp;&nbsp;
        <asp:Button class="button2" ID="uxCopyLineItem" runat="server" Text="Copy Line Item"
            OnClick="uxCopyLineItem_Click" />&nbsp;&nbsp;
        <asp:Button class="button2" ID="uxAddNewRequest" runat="server" Text="Add New Request"
            OnClick="uxAddNewRequest_Click" />&nbsp;&nbsp;
        <asp:Button class="button1" ID="uxViewQuote" runat="server" Text="View Quote" OnClick="uxViewQuote_Click" />
        <asp:Button class="button2" ID="uxExportToExcel" runat="server" Text="Export To Excel"
            OnClick="uxExportToExcel_Click" />
        <%--  <asp:ObjectDataSource ID="LineItemsSource" runat="server"
             SelectMethod="GetLineItems"
             TypeName="Crowley.Pricing.Web.LineItems.ManageLineItems">
         </asp:ObjectDataSource>--%>
    </div>
</asp:Content>





Pavlina
Telerik team
 answered on 21 Sep 2010
1 answer
108 views
I have an issue when increase the page size of the grid when exceeding number of rows in grid. If i have 20 rows in my grid and page size is 5. when i increase the page size to 50 in the dropdownlist that is in grid  footer, then the footer of pagination is hidden. After that i cant reduce the page size.  Thanks waiting for reply.
Pavlina
Telerik team
 answered on 21 Sep 2010
1 answer
413 views
Hello,

I have a RadGrid that I'm attempting to use in form editing on. I'm currently using the following GridTemplateColumn. The problem is that what I really need is an InsertItemTemplate like what asp:DetailsView has. This is because I want the Status field to be editable in a RadComboBox on insert, but, non-editable and displayed in a label on edit. Does anyone know if this is possible in RadGrid? I'm assuming that I'll probably have to handle an event and adjust the visibility of fields based on whether it's in insert or edit mode? The problem is that I don't know what event I should use to do this and I also don't know how to lookup the control. I'm assuming I'll probably have to use FindControl() and maybe use the RowIndex to find the proper row in the grid or something. Any help would be greatly appreciated.

 

 

<asp:TemplateField HeaderText="Status" SortExpression="Status">
                    <EditItemTemplate>
                        <asp:DropDownList ID="DropDownList1" runat="server" SelectedValue='<%# Bind("Status") %>'>
                            <asp:ListItem Text="" Value=""></asp:ListItem>
                            <asp:ListItem Text="Assigned" Value="Assigned"></asp:ListItem>
                            <asp:ListItem Text="Lost" Value="Lost"></asp:ListItem>
                            <asp:ListItem Text="Returned" Value="Returned"></asp:ListItem>
                        </asp:DropDownList>
                        <%--<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Status") %>'></asp:TextBox>--%>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Status") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("Status") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

Jon

Iana Tsolova
Telerik team
 answered on 21 Sep 2010
5 answers
182 views
hi

I'm trying to use this example but without the update panels. I'm trying to use the radajaxmanager but it doesn't work. I've copied the code from the example and put it into my page but the external edit window doesn't popup.

Do you have any examples of how to do this with radajaxmanager? I have pasted the code that I think is important below.

<

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="RadScheduler1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="DiaryEventsMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="SchedulerAppointmentContextMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="SchedulerTimeSlotContextMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="DiaryEventsMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="SchedulerAppointmentContextMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

<telerik:AjaxUpdatedControl ControlID="SchedulerTimeSlotContextMenu" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

<telerik:AjaxSetting AjaxControlID="RadDock1">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="RadDock1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

 



function

 

openForm() {

 

 

var dock = $find('<%=RadDock1.ClientID %>');

 

 

// Center the RadDock on the screen

 

 

var viewPort = $telerik.getViewPortSize();

 

 

var xPos = Math.round((viewPort.width - parseInt(dock.get_width())) / 2);

 

 

var yPos = Math.round((viewPort.height - parseInt(dock.get_height())) / 2);

 

$telerik.setLocation(dock.get_element(), { x: xPos, y: yPos });

dock.set_closed(

false);

 

Sys.Application.remove_load(openForm);

}

 

function hideForm() {

 

 

var dock = $find("<%=RadDock1.ClientID %>");

 

dock.set_closed(

true);

 

 

return true;

 

}

 

function dockMoved(sender, args) {

 

 

//Return RadDock to his original HTML parent so it gets updated via ajax

 

$get(

"<%=DockPanel.ClientID %>").appendChild(sender.get_element());

 

}

 

 

 

<div id="errors">

 

 

</div>

 

 

<telerik:RadScheduler runat="server" ID="RadScheduler1" Width="100%" Height="100%"

 

 

DayStartTime="07:00:00" DayEndTime="19:00:00" DataKeyField="ID" DataSubjectField="Subject"

 

 

DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule"

 

 

Culture="en-GB" DayHeaderDateFormat="dddd, dd MMMM yyyy" DataRecurrenceParentKeyField="RecurrenceParentID"

 

 

OnFormCreating="RadScheduler1_FormCreating" StartEditingInAdvancedForm="false">

 

 

<AppointmentTemplate>

 

 

<asp:Panel ID="AppointmentContainer" runat="server">

 

 

<table cellpadding="0" cellspacing="0" border="0">

 

 

<tr style="vertical-align: top;">

 

 

<td class="icon">

 

 

<asp:ImageButton ID="ImageButtonMoreInfo" ImageUrl="~/App_Themes/HP25/Images/magnify.png"

 

 

OnClientClick="onButtonClick(this,event);" runat="server" AlternateText="Click for more info" />

 

 

</td>

 

 

<td class="text">

 

 

<asp:Label ID="Subject" runat="server" />

 

 

</td>

 

 

</tr>

 

 

<tr id="PropertyRow" runat="server" style="vertical-align: top;">

 

 

<td class="icon">

 

 

<asp:Image ID="PropertyIcon" AlternateText="Property Address" ImageUrl="~/App_Themes/HP25/Images/house.png"

 

 

runat="server" />

 

 

</td>

 

 

<td class="text">

 

 

<asp:Label ID="Property" runat="server" />

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</asp:Panel>

 

 

</AppointmentTemplate>

 

 

<DayView HeaderDateFormat="dddd, dd MMMM yyyy" />

 

 

</telerik:RadScheduler>

 

 

Protected Property EditedAppointmentID() As Object

 

 

Get

 

 

Return ViewState("EditedAppointmentID")

 

 

End Get

 

 

Set(ByVal value As Object)

 

ViewState(

"EditedAppointmentID") = value

 

 

End Set

 

 

End Property

 

 

Protected Sub PopulateEditForm(ByVal editedAppointment As Appointment)

 

 

Dim app = FindAppointmentById(editedAppointment.ID, Appointments)

 

TextBoxDescription.Text = app.Description

TextBoxSubject.Text = app.Subject

 

End Sub

 

 

Protected Sub RadScheduler1_FormCreating(ByVal sender As Object, ByVal e As SchedulerFormCreatingEventArgs)

 

 

If e.Mode = SchedulerFormMode.Insert OrElse e.Mode = SchedulerFormMode.Edit Then

 

EditedAppointmentID = e.Appointment.ID

e.Cancel =

True

 

ScriptManager.RegisterStartupScript(

Me, [GetType](), "formScript", "Sys.Application.add_load(openForm);", True)

 

PopulateEditForm(e.Appointment)

 

End If

 

 

End Sub

 



Thanks
Jon
ChrisC.
Top achievements
Rank 2
 answered on 21 Sep 2010
8 answers
153 views
I have a search text box which fetches data for a grid and populates when the user enters something in the textbox. I have a loading panel attached to the search box. The loading image shows when the first letter is enetered. However, if the user puts in more characters the loading image does not show and there is no indication that the page is fetching the data and the grid is loading. I assume it has to do something with the typing in more characters intercepting the previously sent request but is there a workaround for the loading image to show with each character enetered?

This issue is really troubling our client.

I add this on Page_Load to the text box :

RadTextBoxName.Attributes.Add(

"onkeyup", "setTimeout('__doPostBack(\\'" + RadTextBoxName.ClientID.Replace("_", "$") + "\\',\\'\\')', 0);");

and have this in my AJAXSettings

 

<telerik:RadAjaxManagerProxy ID="RadAJAXManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTextBoxName">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTextBoxName" />
                    <telerik:AjaxUpdatedControl ControlID="errorLabel" />
                    <telerik:AjaxUpdatedControl ControlID="LinkButtonExpandedSearch" />
                    <telerik:AjaxUpdatedControl ControlID="dummyTextBox" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGridContact" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
</telerik:RadAjaxManagerProxy>


Let me know if I can provide more information.

Iana Tsolova
Telerik team
 answered on 21 Sep 2010
6 answers
257 views
Hi Is it possilbe to use the RadGrid in a Hierarchy with multiple table in Dynamic Data, as I seem to have issues
<telerik:DynamicRadGrid 
    ID="RadGrid1" 
    runat="server" 
    AllowPaging="True" 
    AllowSorting="True"
    AutoGenerateDeleteColumn="true" 
    AutoGenerateEditColumn="true"
    AutoGenerateColumns="false" 
    DataSourceID="ProjectsDataSource"
    GridLines="Vertical" 
    Skin="Windows7">
    <MasterTableView DataKeyNames="PKID" DataSourceID="ProjectsDataSource" AutoGenerateColumns="false">
        <Columns>
            <telerik:DynamicGridBoundColumn DataField="ProjectState" HeaderText="Project State" />
            <telerik:DynamicGridBoundColumn DataField="ProjectNumber" HeaderText="Project #"/>
            <telerik:DynamicGridBoundColumn DataField="ACModel" HeaderText="AC Model" />
            <telerik:DynamicGridBoundColumn DataField="Name" />
            <telerik:DynamicGridBoundColumn DataField="CustomerLocation" HeaderText="Customer Location" />
            <telerik:DynamicGridBoundColumn DataField="Description" />
        </Columns>
        <DetailTables>
            <telerik:GridTableView runat="server" DataKeyNames="PKID" DataSourceID="PhasesDataSource" AutoGenerateColumns="false">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="Project_FKID" MasterKeyField="PKID" />
                </ParentTableRelation>
                <Columns>
                    <telerik:DynamicGridBoundColumn DataField="Description" HeaderText="Description" />
                    <telerik:DynamicGridBoundColumn DataField="HourlyRate" HeaderText="Hourly Rate" />
                    <telerik:DynamicGridBoundColumn DataField="EstimateHours" HeaderText="Estimate Hours" />
                    <telerik:DynamicGridBoundColumn DataField="EstimateTotal" HeaderText="Estimate Total" />
                    <telerik:DynamicGridBoundColumn DataField="EstimateStartDate" HeaderText="Estimate Start Date" />
                    <telerik:DynamicGridBoundColumn DataField="EstimateCompletionDate" HeaderText="Estimate Completion Date" />
                    <telerik:DynamicGridBoundColumn DataField="ActualStartDate" HeaderText="Actual Start Date" />
                    <telerik:DynamicGridBoundColumn DataField="ActualCompletionDate" HeaderText="Actual Completion Date" />
                    <telerik:DynamicGridBoundColumn DataField="EngineeringAuthorizations" HeaderText="Engineering Authorizations" />
                    <telerik:DynamicGridBoundColumn DataField="EngineeringType" HeaderText="Engineering Type" />
                    <telerik:DynamicGridBoundColumn DataField="PhaseState" HeaderText="Phase State" />
                    <telerik:DynamicGridBoundColumn DataField="PhaseType" HeaderText="Phase Type" />
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:DynamicRadGrid>
  
<asp:LinqDataSource ID="ProjectsDataSource" runat="server" EnableDelete="true">
    <WhereParameters>
        <asp:DynamicControlParameter ControlId="FilterRepeater" />
    </WhereParameters>
</asp:LinqDataSource>
<asp:LinqDataSource ID="PhasesDataSource" runat="server" ContextTypeName="DD_EPC.Models.EPCDataContext"
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="Phases">
</asp:LinqDataSource>
<asp:LinqDataSource ID="TasksDataSource" runat="server" ContextTypeName="DD_EPC.Models.EPCDataContext"
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="Tasks">
</asp:LinqDataSource>
 When I try this I get the following error
 

Server Error in '/' Application.

The table 'Projects' does not have a column named 'HourlyRate'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Which suggests that the GridTableView is not recognising the DynamicGridBoundColumns I have added. All works fine if I remove the GridTableView Coluns section but I get no DD field templates in the nested grid.
Iana Tsolova
Telerik team
 answered on 21 Sep 2010
1 answer
180 views
Hi,
I need to build a dynamic grid with n-levels hierarchy. Also I need to define n-columns depending of the table the user expanded. To do this, I have 3 object-datasource an a placeholder to programmatically define the radgrid and the detailsgrids asociated. The problem is that when I want to access to the 2nd level (the 1st one is ok), the #grdEntity_DetailTableDataBind event dont fire.

aspx
       
<telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
<!-- Only for master table - level 0 -->
        <asp:ObjectDataSource ID="odsCustomerEntities" runat="server" SelectMethod="GetCustomerEntitiesRows"
            TypeName="EKSClientLibrary.Ecl.clsEclKernelClient" EnablePaging="True" MaximumRowsParameterName="RowCount"
            StartRowIndexParameterName="StartingRow">
            <SelectParameters>
                <asp:Parameter Name="StartingRow" Type="Int32" DefaultValue="1" />
                <asp:Parameter Name="RowCount" Type="Int32" DefaultValue="25" />
                <asp:Parameter Name="pCustPkey" Type="String" DefaultValue="" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <!-- For header tables -> Level 1 - 3 - n -->
        <asp:ObjectDataSource ID="odsEntities" runat="server" SelectMethod="GetEntitiesRows"
            TypeName="EKSClientLibrary.Ecl.clsEclKernelClient" EnablePaging="True" MaximumRowsParameterName="RowCount"
            StartRowIndexParameterName="StartingRow">
            <SelectParameters>
                <asp:Parameter Name="StartingRow" Type="Int32" DefaultValue="1" />
                <asp:Parameter Name="RowCount" Type="Int32" DefaultValue="25" />
                <asp:Parameter Name="pParentPkey" Type="String" DefaultValue="" />
            </SelectParameters>
        </asp:ObjectDataSource>
   <!-- For detail tables -> Level 2 - 4 - n -->
<asp:ObjectDataSource ID="odsEntitiesDetails" runat="server" SelectMethod="GetEntitiesDetailsRows"
            TypeName="EKSClientLibrary.Ecl.clsEclKernelClient" EnablePaging="True" MaximumRowsParameterName="RowCount"
            StartRowIndexParameterName="StartingRow">
            <SelectParameters>
                <asp:Parameter Name="StartingRow" Type="Int32" DefaultValue="1" />
                <asp:Parameter Name="RowCount" Type="Int32" DefaultValue="25" />
                <asp:Parameter Name="pPkey" Type="String" DefaultValue="" />
                <asp:Parameter Name="pParentPkey" Type="String" DefaultValue="" />
                <asp:Parameter Name="pRelatedTable" Type="String" DefaultValue="" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="PlaceHolder1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PlaceHolder1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>


vb

   
Private Sub DefineGridStructure()
        'Definicion global
        grdEntity = New RadGrid
        Dim column1 As GridBoundColumn
 
        'Nivel 0
        With grdEntity
            .DataSourceID = "odsCustomerEntities"
            .ID = "grdEntity"
            .Width = Unit.Percentage(100)
            .PageSize = 5
            .AllowPaging = True
            .PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
 
            'Columnas
            .AutoGenerateColumns = False
            column1 = New GridBoundColumn
            column1.DataField = "C03"
            column1.HeaderText = "Entidad"
            .MasterTableView.Columns.Add(column1)
 
            .GroupingEnabled = False
            .ShowGroupPanel = False
            .ShowStatusBar = True
            .ClientSettings.AllowDragToGroup = False
 
            .MasterTableView.PageSize = 15
            .MasterTableView.DataKeyNames = New String(2) {"Pkey", "ParentPkey", "RelatedTable"}
            .MasterTableView.EnableViewState = True
            '.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand
 
        End With
 
        'Nivel 1
        Dim view1 = New GridTableView(grdEntity)
        view1.Name = "EntityDetails"
        view1.EnableViewState = True
        grdEntity.MasterTableView.DetailTables.Add(view1)
 
        'Add grid to place holder
        Me.PlaceHolder1.Controls.Add(grdEntity)
    End Sub
 
    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        mCustomerPkey = ""
        DefineGridStructure()
    End Sub
 
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        mCustomerPkey = Request.QueryString("CustPkey")
        Dim grid As RadGrid = CType(PlaceHolder1.FindControl("grdEntity"), RadGrid)
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(grid, grid)
    End Sub
 
    Public Sub odsCustomerEntities_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles odsCustomerEntities.Selecting
        With e.InputParameters
            .Item("pCustPkey") = mCustomerPkey
        End With
    End Sub
 
    Private Sub grdEntity_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles grdEntity.DetailTableDataBind
        Debug.Print("grdEntity_DetailTableDataBind")
        Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
        Select Case e.DetailTableView.Name
            Case "EntityDetails"
                Dim relationFields As GridRelationFields
                Dim wPkey As String = dataItem.GetDataKeyValue("Pkey").ToString()
                Dim wParentPkey As String = dataItem.GetDataKeyValue("ParentPkey").ToString()
                Dim wRelatedTable As String = dataItem.GetDataKeyValue("RelatedTable").ToString()
                With e.DetailTableView
                    .DataSourceID = "odsEntitiesDetails"
                    .DataKeyNames = New String(2) {"Pkey", "ParentPkey", "RelatedTable"}
                    .Width = Unit.Percentage(100)
 
                    'Columnas
                    '.AutoGenerateColumns = True
                    Dim wColumn As GridBoundColumn
                    wColumn = New GridBoundColumn
                    wColumn.DataField = "Pkey"
                    wColumn.HeaderText = "Pkey"
                    .Columns.Add(wColumn)
                    wColumn = New GridBoundColumn
                    wColumn.DataField = "ParentPkey"
                    wColumn.HeaderText = "ParentPkey"
                    .Columns.Add(wColumn)
                    wColumn = New GridBoundColumn
                    wColumn.DataField = "RelatedTable"
                    wColumn.HeaderText = "RelatedTable"
                    .Columns.Add(wColumn)
                    Dim wEntityColumns As EntityColumnType()
                    wEntityColumns = GetEksClientInstance.GetEntitiesDetailsColumns(GetTicket(), wPkey, wRelatedTable)
                    For i = 0 To wEntityColumns.GetLength(0) - 1
                        wColumn = New GridBoundColumn
                        'wColumn.DataField = wEntityColumns(i).Code
                        wColumn.DataField = "C0" & i.ToString.Trim
                        wColumn.HeaderText = wEntityColumns(i).Description
                        .Columns.Add(wColumn)
                    Next
 
                    'Relaciones
                    relationFields = New GridRelationFields()
                    relationFields.MasterKeyField = "Pkey"
                    relationFields.DetailKeyField = "pPkey"
                    .ParentTableRelation.Add(relationFields)
 
                    relationFields = New GridRelationFields()
                    relationFields.MasterKeyField = "ParentPkey"
                    relationFields.DetailKeyField = "pParentPkey"
                    .ParentTableRelation.Add(relationFields)
 
                    relationFields = New GridRelationFields()
                    relationFields.MasterKeyField = "RelatedTable"
                    relationFields.DetailKeyField = "pRelatedTable"
                    .ParentTableRelation.Add(relationFields)
 
                    'Nivel 2
                    Dim view2 = New GridTableView(grdEntity)
                    view2.Name = "Entity"
                    view2.EnableViewState = True
                    .DetailTables.Add(view2)
                End With
            Case "Entity"
                Dim relationFields As GridRelationFields
                Dim wPkey As String = dataItem.GetDataKeyValue("Pkey").ToString()
                Dim wParentPkey As String = dataItem.GetDataKeyValue("ParentPkey").ToString()
                Dim wRelatedTable As String = dataItem.GetDataKeyValue("RelatedTable").ToString()
                With e.DetailTableView
                    .DataSourceID = "odsEntities"
                    .Width = Unit.Percentage(100)
                    .DataKeyNames = New String(2) {"Pkey", "ParentPkey", "RelatedTable"}
 
                    'Columnas
                    Dim column1 = New GridBoundColumn
                    column1.DataField = "C03"
                    column1.HeaderText = "Entidad"
                    .Columns.Add(column1)
 
                    'Relaciones
                    relationFields = New GridRelationFields()
                    relationFields.MasterKeyField = "Pkey"
                    relationFields.DetailKeyField = "pPkey"
                    .ParentTableRelation.Add(relationFields)
 
                    relationFields = New GridRelationFields()
                    relationFields.MasterKeyField = "ParentPkey"
                    relationFields.DetailKeyField = "pParentPkey"
                    .ParentTableRelation.Add(relationFields)
 
                    relationFields = New GridRelationFields()
                    relationFields.MasterKeyField = "RelatedTable"
                    relationFields.DetailKeyField = "pRelatedTable"
                    .ParentTableRelation.Add(relationFields)
 
                    'Nivel 1
                    Dim view1 = New GridTableView(grdEntity)
                    view1.Name = "EntityDetails"
                    view1.EnableViewState = True
                    .DetailTables.Add(view1)
                End With
        End Select
    End Sub

Radoslav
Telerik team
 answered on 21 Sep 2010
1 answer
135 views
I'm trying to use autopostbackonfilter to enable the users to enter a date or date fragment and have the filter return all records that contain that date fragment.  This is my code:

 

 

<telerik:GridBoundColumn DataField="InvitedOn" HeaderText="First Invited On" UniqueName="InvitedOn" AutoPostBackOnFilter="true">
</telerik:GridBoundColumn>


It works just fine when the user enters the date or date fragment, but if the user enters text that is not in date format, e.g. "ddd" or "9/15/20100," it returns all records.  I would expect it to return no records in these cases.  How can I get the expected behavior?

Thanks!

Laurie 

 

Pavlina
Telerik team
 answered on 21 Sep 2010
1 answer
93 views
I'm wanting to try a developer as a test with ASP.NET AJAX and if successful am planing on purchasing it for a business. I know he can download a trial version, but can the resulting one page site be published to a hosted site that isn't a working site (not my company URL) to evaluate his skills?

My only other recourse is to place the project up for bids with developers that have their own license.

Thanks
Dimo
Telerik team
 answered on 21 Sep 2010
1 answer
177 views
Hi there,

I'm trying to print my schedule. Just like what this does:

http://demos.telerik.com/schedulebuilder/

But I couldn't print anything. I don't quite understand how to make telerik scheduler and telerik reporting work together.

In my EventReport.aspx.cs file, I can't use the code which works perfectly for

http://demos.telerik.com/schedulebuilder/

using EventScheduler.Reporting;

public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        EventsReport eventsReport = new EventsReport();
        ReportViewer1.Report = eventsReport;
    }
}

Each time I use the code above, I will get this error:

Could not load file or assembly 'Telerik.Reporting, Version=3.2.9.1006, Culture=neutral, PublicKeyToken=a9d7983dfcc261be' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)


Actually I'm not using Telerik.Reporting, Version=3.2.9.1006 at all.

And I added another project in my existing project , in which i created report using Telerik Reporting.  I'm not sure how my report can be used to work together with scheduler.

Any help will be appreciated.
Peter
Telerik team
 answered on 21 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?