Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
395 views
Hi

I am using the radeditor in server side code to export some data to a pdf. Just add a bit of html and hey presto! :)
Can I set page header and footers? I want a "Page # of 10" at the bottom of each page for example.

Kind Regards,
Jeremy
Jeremy
Top achievements
Rank 1
 answered on 24 Aug 2010
3 answers
1.0K+ views

 

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ctrlUserProfilePics.ascx.cs" 
    Inherits="OmegaLove.Web.UI.ctrlUserProfilePics" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %> 
<%@ Register Src="ctrlUserProfilePicsText.ascx" TagName="ctrlUserProfilePicsText" 
    TagPrefix="uc1" %> 
 
 
 
<div class="accordionContent" style="display: block;">  
    <div class="boxContent">  
        <div style="padding-left: 15px; padding-right: 15px;">  
            <uc1:ctrlUserProfilePicsText ID="ctrlUserProfilePicsText" runat="server" /> 
            <table cellspacing="2" cellpadding="0" width="800" border="0">  
                <tbody> 
                    <tr> 
                        <td align="center" colspan="3">  
                            <%--<asp:Image ID="ImgFullSize" runat="server" Style="border: 4px solid white" ImageUrl="~/Images/NoPhoto.jpg" 
                                CssClass="photo_198" />--%> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td valign="middle" align="center" width="40">  
                            &nbsp;  
                        </td> 
                        <td align="center">  
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
                                <ContentTemplate> 
                                    <asp:DataList ID="DLThumbnails" runat="server" DataKeyField="img_id" RepeatDirection="Horizontal" 
                                        CellSpacing="5" CellPadding="0" HorizontalAlign="Center" CssClass="view" RepeatColumns="5" 
                                        Item-BorderWidth="1" Item-BorderColor="#c0c0c0" OnItemDataBound="DLThumbnails_ItemDataBound" 
                                        OnItemCommand="DLThumbnails_ItemCommand">  
                                        <ItemTemplate> 
                                            <table cellspacing="7" cellpadding="0" border="0">  
                                                <tr valign="top">  
                                                    <td> 
                                                        <span class="verdana12"><b>Main profile photo</b></span<span id="top_1"></span> 
                                                    </td> 
                                                </tr> 
                                                <tr height="150" valign="top">  
                                                    <td> 
                                                        <div style="position: relative; height: 148px;">  
                                                            <asp:Image runat="server" ID="view_image" Width="118" Height="148" alt='Photo from Album Number <%# Eval("img_id") %>' /> 
                                                        </div> 
                                                        <br /> 
                                                        <asp:LinkButton ID="lnkRemove" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem, "img_id")%>' 
                                                            Text="Delete Photo" OnClick="DeleteImage"></asp:LinkButton> 
                                                        <%--      <asp:LinkButton ID="delete" runat="server" Text="Delete Photo" CommandName="Delete" 
                                                            CommandArgument='<%#DataBinder.Eval(Container.DataItem, "img_id")%>'></asp:LinkButton>--%> 
                                                        <%-- <asp:ImageButton ID="ImgButtonDeletePhoto" runat="server" ImageUrl="~/Images/Buttons/delete-image.gif" 
                                                    Visible="true" OnClientClick="ImgButtonDeletePhoto_Click" />--%> 
                                                    </td> 
                                                </tr> 
                                            </table> 
                                        </ItemTemplate> 
                                        <AlternatingItemStyle BackColor="White" /> 
                                        <ItemStyle Width="20%" BackColor="#EFF3FB" /> 
                                        <SelectedItemStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" /> 
                                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> 
                                        <FooterTemplate> 
                                        </FooterTemplate> 
                                    </asp:DataList> 
                                </ContentTemplate> 
                                <Triggers> 
                                    <asp:AsyncPostBackTrigger ControlID="DLThumbnails" /> 
                                </Triggers> 
                            </asp:UpdatePanel> 
                            <div id="AlertDiv" class="AlertStyle">  
                            </div> 
                            <%--  <asp:Panel ID="Panel1" runat="server" Visible="false" CssClass="nullpanel">  
                                        There are currently no pictures in your profile.</asp:Panel> 
                                    <br /> 
                                    <br />--%> 
                        </td> 
                        <td valign="middle" align="center" width="40">  
                            &nbsp;  
                        </td> 
                    </tr> 
                    <tr> 
                        <td> 
                            &nbsp;  
                        </td> 
                        <td align="center">  
                            <%--<asp:Label ID="lblCurrentPage" runat="server" Font-Names="Trebuchet MS" Font-Size="12px" 
                                ForeColor="White"></asp:Label>--%> 
                        </td> 
                        <td> 
                            &nbsp;  
                        </td> 
                    </tr> 
                </tbody 
When I go over a link button
the following appears:

javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl00$cph1$cph1$RadPanelBar5$i0$i0$ctrlUserProfilePics$DLThumbnails$ctl01$lnkRemove", "", true, "", "", false, true))

Reza
Top achievements
Rank 1
 answered on 24 Aug 2010
2 answers
76 views
Hi,

Data is not shown in the calender while binding. But, when i place it on by mouse, the name is shown in the tool tip.
I've uploaded my image for your preview.

.aspx page:
----------
 
   <telerik:RadScheduler runat="server" ID="RadScheduler1" Height="500px" Skin="Web20"
                    CustomAttributeNames="StartTime,EndTime,SessionDate,DisplayPermitName,EventStartDate,EventEndDate"
                    ShowViewTabs="true" ShowHeader="true" ShowFooter="true" SelectedDate="2010-07-10"
                    DataStartField="EventStartDate" DataEndField="EventEndDate" EnableDescriptionField="true"
                    AppointmentStyleMode="Default" DayStartTime="08:00:00" DayEndTime="21:00:00" Visible="true"
                    DataKeyField="ID" ReadOnly="false" FirstDayOfWeek="Monday" LastDayOfWeek="Friday"
                    DataSubjectField="DisplayPermitName" ColumnWidth="100px" EnableEmbeddedSkins="false" AllowDelete="false" AllowEdit="false" AllowInsert="false"
                    OnNavigationComplete="radScheduler1_NavigationComplete">
                    <AdvancedForm Modal="true" />
                    <AppointmentTemplate>
                        <%-- <%--Permit Name--%>
                        <asp:Label runat="server" Text='<%# Eval("DisplayPermitName")%>' ID="labelDisplayPermitName" Text="Permit Name :">
                              
                        </asp:Label>
                        <br />
                        <%--Start Time--%>
                        <asp:Label runat="server" ID="labelStartTime" Text="Start Time :">
                             <%# Eval("StartTime")%>
                             <br />
                        </asp:Label>
                        <%--End Time--%>
                         <asp:Label runat="server" ID="labelEndTime" Text="End Time : ">
                             <%# Eval("EndTime")%>
                             <br />
                        </asp:Label>
                        <%--Session Date--%>
                         <asp:Label runat="server" ID="labelSessionDate" Text="Session Date :">
                             <%# Eval("SessionDate")%>
                        </asp:Label>
                        <br />
                    </AppointmentTemplate>
                </telerik:RadScheduler>
 
.cs Page
--------
 
 /// <summary>
        /// Populates the controls with data from the Business Objects.
        /// ClassReg20 User Interface will perform the concrete implementation of this method.
        /// </summary>
        protected override void FillControls()
        {
            try
            {
                this.AdminController.State.Session.Schedule = new Schedule(userSession);
                this.AdminController.State.Session.Schedules = this.AdminController.RetrieveAllEventSchedules();
                this.RadScheduler1.DataSource = this.AdminController.State.Session.Schedules;
                DateTime dataStartTime = DateTime.Parse(this.AdminController.State.Session.Schedules[0].SessionDate.ToString());
                //this.RadScheduler1.DataStartField = dataStartTime.ToString("u").Substring(0, 10);
                DateTime dataEndTime = DateTime.Parse(this.AdminController.State.Session.Schedules[this.AdminController.State.Session.Schedules.Count - 1].SessionDate.ToString());
                //this.RadScheduler1.DataEndField = dataEndTime.ToString("u").Substring(0, 10);
 
                foreach (Schedule schedule in this.AdminController.State.Session.Schedules)
                {
                    dataStartTime = DateTime.Parse(schedule.SessionDate.ToString());
                    dataEndTime = DateTime.Parse(schedule.SessionDate.ToString());
                    schedule.EventStartDate = dataStartTime.ToString("u").Substring(0, 10);
                    schedule.EventEndDate = dataEndTime.ToString("u").Substring(0, 10);
                }
 
                this.RadScheduler1.DataBind();
            }
}

Thanks,
Janni Daniel.B
Jerry T.
Top achievements
Rank 1
 answered on 23 Aug 2010
0 answers
116 views
Hi,
       I am trying to use the AjaxToolkit control (ToggleButtonExtender) inside the GridTemplateColumn   but its giving me error :

Generation of designer file failed: Type 'Telerik.Web.UI.GridTemplateColumn' does not have a public property named 'ToggleButtonExtender'. 

Let me know, how i can do that. Thanks,

Regards,

Osman

found answer, i wasn't using the itemtemplate. Thanks
Osmon
Top achievements
Rank 1
 asked on 23 Aug 2010
4 answers
209 views
I am having an issue with using RadAjaxManager to rebind 2 RadGrids. Here is basically how my page is setup:

RadAjaxManager
   RadMultiPage
RadPageView1
   RadGrid1
RadPageView2
   RadGrid2

What I want to happen is when closing a RadWindow I call a javascript function on the parent page and pass an argument to determine which RadGrid I want to rebind. This works fine when I am trying to update only 1 RadGrid and do not have the other RadGrid specified in the properties of the RadAjaxManager. I'm not sure if it doesn't work because I have setup the RadAjaxManager improperly or what, but I receive the following error every time I try to rebind a RadGrid via Javascript when closing a RadWindow. 

Error: "Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_ctl00_DefaultContentPlaceHolder_FMSContentPlaceHolder_ctl00_ctl00_
DefaultContentPlaceHolder_FMSContentPlaceHolder_rgOrdersReceivedPanel'.
If it is being updated dynamically then it must be inside another UpdatePanel."

Here is my code:

RadWindow Javascript to call refreshGrid function on parent page:
function refreshGrid() {
          var oWindow = GetRadWindow();
          oWindow.BrowserWindow.refreshGrid("Inventory");
          oWindow.Close();
      }

Parent Page Javascript:
function refreshGrid(arg) {
            if (arg == "Rebind") {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            }
            else if (arg == "Inventory") {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Inventory");
            }
    }


<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgInventory" />
                    <telerik:AjaxUpdatedControl ControlID="rgOrdersReceived" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadWindowManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgInventory" />
                    <telerik:AjaxUpdatedControl ControlID="odsInventory" />
                    <telerik:AjaxUpdatedControl ControlID="odsInventoryReceived" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgInventory">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="destroyWin" />
                    <telerik:AjaxUpdatedControl ControlID="rgInventory" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgOrdersReceived">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgOrdersReceived" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            </AjaxSettings>
    </telerik:RadAjaxManager>

Code Behind:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            rgOrdersReceived.Rebind();
        }
        else if (e.Argument == "Inventory")
        {
            rgInventory.Rebind();
        }
    }


Casey
Top achievements
Rank 1
 answered on 23 Aug 2010
2 answers
125 views
I've tried changing the default spellchecker to use an en-GB dictionary I downloaded via another forum post on here, but I'm running into difficulty.

If I set the language property to "en-GB", I'd expect it to use the en-GB dictionary in app_data, but instead it still looks for the en-US dictionary instead.

If I add a languages block, either in the aspx, or in the toolsfile, or programmatically, and add "en-GB", "UK English" as a new spellcheck language, I get prompted to pick it when I click the spellcheck icon, as opposed to just defaulting to it as the only dictionary available, but at least this proves the new dictionary works.

What I want is for the UK english dictionary to be the default, and to spellcheck using it without asking for the user to choose a dictionary.  I'm almost tempted to edit the accompanying scripts to see if I can avoid this, but I hope I'm just doing it wrong.  Any ideas?

The other option is to just give up, and expect our users to pick it every time, but I'm sure they will complain about that.


Andrew Johns
Top achievements
Rank 1
 answered on 23 Aug 2010
2 answers
139 views
I'm using the "Simple" skin for my RadAjaxLoadingPanel, but I want to change the background color to black instead of white surrounding the loading image. The BackColor="Black" doesn't work.
Pontus Johansson
Top achievements
Rank 1
 answered on 23 Aug 2010
5 answers
152 views

I am using RADSplitter. On my page I have header which is not part of the splitter.

In the splitter, I have 2 pans. Main pan is for data entry which has RadTabStrip and RadMultipageView and a RadGrid.  Right pan holds RadPanelBar which is being used as menu. 

I have wrapped all header, mainpan and rightpan in 3 separate AJAXPanels and also attached LoadingPanel.  Basically, when user chooses an option from RightPan (RadPanelBar), I would like to perform database action and show the changes in header and mainpan.  The code works fine. I could even see the changes in debug mode but the changes are not being reflected on the screen.  The changes are there when I hit refresh option on the browser.

Is there any limit on the number of page elements that a AjaxPanel can hold?  Please let me know what am I doing wrong?

The following is my AjaxSetting. 
<telerik:AjaxSetting AjaxControlID="RightPanRadAjaxPanel">
    <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="MainPanRadAjaxPanel" LoadingPanelID="RadAjaxLoadingPanel1" />
          <telerik:AjaxUpdatedControl ControlID="HeaderRadAjaxPanel" />
    </UpdatedControls>
</telerik:AjaxSetting>

Thank you in advance.

Pavlina
Telerik team
 answered on 23 Aug 2010
1 answer
138 views
Pavlina
Telerik team
 answered on 23 Aug 2010
2 answers
99 views
When I hit the back button in my browser and return to a page that has a RadGrid with selected items I am getting 0 for the length of get_selectedItems().  The following code is wired to the RadGrid's OnGridCreated ClientEvent.  I can see in the browser that when I return to the page my previously selected items in the RadGrid return to their selected state. 

The necessary code is found below.  Is there a better ClientEvent to subscribe to that will catch the RadGrid after it's selected items have been repopulated?  The code snippet below is also wired to the RowSelected and RowDeselected ClientEvents and it functions properly.  It is just a problem of running this code when my grid items selected state has been established after hitting the back button in my browser.

var grid = $find('<%= gvNodes.ClientID %>');            
var gridSelectedItems = grid.get_selectedItems();

if
 (gridSelectedItems.length == 1) {
// enable a rad tool bar button

else {
// disable a rad tool bar button
}
Brian McRaven
Top achievements
Rank 1
 answered on 23 Aug 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?