Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
303 views
I would like to know if it is possible to use RadScheduler with MVC3 Razor Engine. In this blog, there is an example with aspx. But I would like to know if it is possible with cshtml. 

http://www.telerik.com/community/code-library/aspnet-ajax/scheduler/using-scheduler-with-an-asp-net-mvc-controller-instead-of-a-web-service.aspx



I came across a method of using ascx file in cshtml and There by using RadScheduler in the Ascx files. Any pointers or examples would be appreciated. 

Thanks
Plamen
Telerik team
 answered on 15 Nov 2013
1 answer
104 views
Hi

I am having an issue rooted in the RadTabBar with multi page view.

I am added a number of controls to a RadPanelBar.  I am adding HtmlGenericControls with hyperlinks to documents and an album control (other 3rd party) that binds to a list of files (jpeg, etc).  When I add this control the RadPanelBar, and add the RadPanelBar to the page (via a PlaceHolder), all works as expected.  I have my docs and my image album.

However, if I move the PlaceHolder into a RadTab, the RadPanelPar renders, the documents are present, the html shows the album (and supporting jscript), but does not seem to bind the actual images... they are not present.

Move the Placeholder out of the RadTab... all works again.

Here is the code oh how I am building all this up 

private void BuildAttachments()
        {
            List<String> photoPaths = new List<String>();
            List<String> docPaths = new List<String>();
            List<ServiceNote> notes = new List<ServiceNote>();
 
            Telerik.Web.UI.RadPanelBar panelBar = new RadPanelBar();
            panelBar.ID = ticketId.ToString();
            panelBar.ExpandMode = PanelBarExpandMode.SingleExpandedItem;
            panelBar.Width = 960;
 
            int y = 0;
            foreach (ServiceTicketTask task in ThisTicket.ServiceTicketTasks)
            {
                RadPanelItem panelItem = new RadPanelItem();
                panelItem.Text = task.ServiceItem.Name;
                panelBar.Items.Add(panelItem);
 
                panelItem.Enabled = false;
 
                foreach (ServiceNote note in task.ServiceNotes.Where(n => n.HasPictures).OrderBy(n => n.CreateDate))
                {
                    RadPanelItem panelNoteItem = new RadPanelItem();
                    panelNoteItem.Text = DateTimeFunctions.UtcToMyTime(note.CreateDate, _loggedInUser.TimeZoneId).ToString();
 
                    panelItem.Items.Add(panelNoteItem);
 
                    RadPanelItem panelImageItem = new RadPanelItem();
                    panelImageItem.Text = Labeling.Photos;
                    panelImageItem.Expanded = true;
                    panelNoteItem.Items.Add(panelImageItem);
 
                    RadPanelItem panelDocsItem = new RadPanelItem();
                    panelDocsItem.Text = Labeling.Documents;
                    panelDocsItem.Expanded = true;
                    panelNoteItem.Items.Add(panelDocsItem);
 
 
                    String photoPath = Storage.GetGalleryPath(ServiceTicket.MakeServiceTicketName(note.ServiceTicketTask.ServiceTicket.ServiceProvider.Abbrev, note.ServiceTicketTask.ServiceTicket.TicketName),
                                                                       note.ServiceTicketTask.CatalogItem.Name,
                                                                       note.CreateDate,
                                                                       Storage.DocumentGroups.Photos);
 
                    if (photoPath != null)
                    {
                        panelItem.Enabled = true;
 
                        String galleryID = String.Format("galleryServiceTickets_{0}", y);
 
                        GalleryBrowser galleryServiceTickets = new GalleryBrowser();
                        galleryServiceTickets.ID = galleryID;
                        galleryServiceTickets.Visible = true;
                        galleryServiceTickets.Width = 940;
                        galleryServiceTickets.Height = 50;
 
                        galleryServiceTickets.AllowEdit = false;
                        galleryServiceTickets.AllowPostComment = false;
                        galleryServiceTickets.AllowShowComment = false;
                        galleryServiceTickets.Layout = "Gridshow";
                        galleryServiceTickets.LogonUserName = _loggedInUser.FullName;
                        galleryServiceTickets.GalleryFolder = photoPath;
                        galleryServiceTickets.ToolTip = String.Format("{0} - {1}", note.ServiceTicketTask.ServiceItem.Name, note.CreateDate);
 
                        galleryServiceTickets.DataBind();
 
                        TemplateItem template = new TemplateItem(galleryServiceTickets);
                        template.InstantiateIn(panelImageItem);
                    }
 
                    String docPath = Storage.GetGalleryPath(ServiceTicket.MakeServiceTicketName(note.ServiceTicketTask.ServiceTicket.ServiceProvider.Abbrev, note.ServiceTicketTask.ServiceTicket.TicketName),
                                                                     note.ServiceTicketTask.CatalogItem.Name,
                                                                     note.CreateDate,
                                                                     Storage.DocumentGroups.Docs);
 
                    if (docPaths != null)
                    {
                        panelItem.Enabled = true;
 
                        List<String> filePaths = new List<String>();
                        filePaths = Storage.GetFileCount(docPath);
 
                        HtmlGenericControl divInner = new HtmlGenericControl("div");
                        divInner.ID = String.Format("DocDiv_{0}", y);
                        divInner.Attributes.Add("style""margin:0;padding:2px 0 0 6px;width:1000px;float:left;text-align:left");
 
                        Int32 i = 0;
 
                        foreach (String file in filePaths)
                        {
                            String newFile = file.Replace(HttpContext.Current.Server.MapPath(docPath), "").Replace("\\""");
                            String newFilePath = docPath + "/" + newFile;
 
                            HyperLink hlnkImage = new HyperLink();
                            hlnkImage.ID = String.Format("hlnkImage_{0}_{1}", y, i);
                            hlnkImage.ImageUrl = Utils.GetIcon(newFile);
                            hlnkImage.SkinID = "hlnkImage";
                            hlnkImage.NavigateUrl = newFilePath;
                            hlnkImage.Target = "_blank";
                            hlnkImage.ToolTip = newFile;
 
                            divInner.Controls.Add(hlnkImage);
 
                            TemplateItem template = new TemplateItem(divInner);
                            template.InstantiateIn(panelDocsItem);
 
                            i = i + 1;
                        }
                    }
 
                    y++;
                }
            }
            
            HtmlGenericControl scrollDiv = new HtmlGenericControl("div");
            if (notes.Count() > 15)
                scrollDiv.Attributes.Add("style""float:left;overflow:scroll;overflow-y:hidden; width:940px;");
            else
                scrollDiv.Attributes.Add("style""float:left; width:940px;");
 
 
            scrollDiv.Controls.Add(panelBar);
            plAttachments.Controls.Add(scrollDiv);
        }
 public class TemplateItem : ITemplate
    {
        Control control;
        #region ITemplate Members
        public void InstantiateIn(Control container)
        {
            container.Controls.Add(control);
        }
        #endregion
        public TemplateItem(Control ctrl)
        {
            control = ctrl;
        }
    }


I have moving the call to this method from the page_init to page_load, as well as calling it from within the load event of the tab itself.  In ll cases the results are the same.

I also moved all this code to a usercontrol and then added the usercontrol to the RadTab... same result

Thanks for any help...
Nencho
Telerik team
 answered on 15 Nov 2013
3 answers
119 views
Hi All,

I have just updated AjaxControlToolKit to 3.5.7, I am using VS2008 web application. After updating the dll in my application, I am getting below error on default login page. 

Microsoft JScript runtime error: Unable to get value of the property 'UI': object is null or undefined

  When I ignores this error, and proceeds for Log in, it doesn't do any thing, even it don't fires any event nothing is working. Need urgent help. Thanks in advance.
Ajinkya
Top achievements
Rank 1
 answered on 15 Nov 2013
1 answer
260 views
There is a radtextbox which is initially disabled and I am trying to enable it from js like below
radtextbox.set_enabled(true) but the textbox is not enabled.Any idea?
Shinu
Top achievements
Rank 2
 answered on 15 Nov 2013
1 answer
45 views
Is it possible to add a page level header when exporting to Excel?

What I would like to see when the PivotGrid is exported to Excel would be something along the following lines:

------------------------------------------------------------------------------------------------------------

                                                                                 CUSTOM REPORT HEADER

Advanced Services Ace Continential World Corp Digital Corporate Executive Imagination
Bulgaria Sofia Microvan $93446.4 $102791.0 $93446.4 $93446.4
Minivan $126152.6 $130825.0 $93446.4 $88774.1
Pickup $88774.1 $70084.8 $74757.1 $116808.0
Truck $121480.3 $112135.7 $107463.4 $56067.8
Van $98118.7 $102791.0 $121480.3 $121480.3
Sofia Total $527972.2 $518627.5 $490593.6 $476576.6
Bulgaria Total $527972.2 $518627.5 $490593.6 $476576.6
France Paris Microvan $146225.8 $191743.7 $172310.4 $122042.0
Minivan $107790.7 $119709.6 $124460.0 $94402.4
Pickup $127224.0 $167991.5 $134738.4 $150976.2
Grand Total $2786144.2 $2816203.7 $2784985.4 $2668372.7
Kostadin
Telerik team
 answered on 15 Nov 2013
3 answers
291 views
Hi,
I could try to make a nested grouping with RadGrid.
The first field to group is "Campionato" (Champion),
the second is "Gara" (Game)

I can do this work with drag &drop column (see attahced Correct.png).
but I want that this grouping is fixed when load Grid (client or server)

I can add GridGroupByField in aspx 
<telerik:RadGrid ID="gvList" runat="server" PageSize="20" AllowSorting="True" AllowPaging="True"
                   ShowGroupPanel="True" AutoGenerateColumns="False" GridLines="None">
                   <PagerStyle Mode="NumericPages"></PagerStyle>
                   <MasterTableView Width="100%" GroupLoadMode="Server" TableLayout="Fixed">
                       <GroupByExpressions>
                           <telerik:GridGroupByExpression>
                               <SelectFields>
                                   <telerik:GridGroupByField FieldAlias="CAMPIONATO" FieldName="C01_B04_CODE_FK"></telerik:GridGroupByField>
                                   <telerik:GridGroupByField FieldAlias="GARA" FieldName="C01_GARA_PK"></telerik:GridGroupByField>
                               </SelectFields>
                               <GroupByFields>
                                   <telerik:GridGroupByField FieldName="C01_B04_CODE_FK"></telerik:GridGroupByField>
                               </GroupByFields>
                           </telerik:GridGroupByExpression>
                       </GroupByExpressions>
or use che code behind
 
GridGroupByExpression expression = new GridGroupByExpression();
        GridGroupByField existing = expression.SelectFields.FindByName("C01_GARA_PK");
  
        GridGroupByField field = new GridGroupByField();
        field.FieldName = "C01_B04_CODE_FK";
        field.FieldAlias = "CAMPIONATO";
  
        GridGroupByField field = new GridGroupByField();
        field.FieldName = "C01_GARA_PK";
        field.FieldAlias = "GARA";
  
        expression.SelectFields.Add(field);
  
        gvList.MasterTableView.GroupByExpressions.Add(expression);
        gvList.Rebind();

but the result is wrong (see attached Wrong.png)

HoW do i do ?
Marin
Telerik team
 answered on 15 Nov 2013
1 answer
64 views
Its giving below error while exporting the radscheduler timeline view ...


'10' is an unexpected token. The expected token is '"' or '''. Line 11, position 27.


Thanks
Vijay Joshi
Bozhidar
Telerik team
 answered on 15 Nov 2013
3 answers
124 views
I have a Rad Autocomplete Box returning 3 values via web service, I also have several Rad windows on the page.  What I am trying to do is get those values from the auto complete box and load a certain Rad Window based on the values returned from the auto complete box.  I am having issues getting those values, when I try to grab the values and pass them to the rad window it conflicts with the select function.  I was wondering if there is a way to call a function inside a function, if so how do I accomplish this task?

Below is my code.

        function LoadWindow(Type) {
             var radDash = $find("<%= radDashboard.ClientID%>");
                      if (Type == 1) {
                          radDash.setUrl("ManageProcessor.aspx");
                      }
                      else if (Type == 2) {
                          radDash.setUrl("WoTracker.aspx");
                      }
                      else if (Type == 3) {
                          radDash.setUrl("WoTracker.aspx");
                      }
                      else if (Type == 4) {
                          radDash.setUrl("WoTracker.aspx");
                      }
                      else if (Type == 5) {
                          radDash.setUrl("PriorService.aspx");
                      }
                      else if (Type == 6) {
                          radDash.setUrl("WorkingRecruits.aspx");
                      }
                      radDash.show();
                      radDash.maximize();
         }
    </script>
    <script>       
         $(document).ready(function () {
             BindControls();
         });
         function BindControls() {
             $("#<%= txtSearch.ClientID%>").autocomplete({
                         source: function (request, response) {
                             $.ajax({
                                 url: "../Recruiting.asmx/FindRecID",
                                 data: "{ 'sLookUP': '" + request.term + "' }",
                                 dataType: "json",
                                 type: "POST",
                                 contentType: "application/json; charset=utf-8",
                                 dataFilter: function (data) { return data; },
                                 success: function (data) {
                                     response($.map(data.d, function (item) {
                                         return {
                                             label: item.split("-")[0],
                                             val: item.split("-")[1],
                                             ID: item.split("-")[2]
                                         }
                                     }))
                                 },
                                 error: function (response) {
                                     alert(response.responseText);
                                 }
                             });
                         },
 
                         select: function (e, i) {
                             $("#<%= HFRecruit.ClientID%>").val(i.item.val);
                             $("#<%= HFId.ClientID%>").val(i.item.ID);                            
                         },
 
                minLength: 2    // MINIMUM 1 CHARACTER TO START WITH.
            });
            }
    </script>
        <link href="../Recuiting.css" rel="stylesheet" />
    <link href="../Styles/Styles.css" rel="stylesheet" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" Runat="Server">
    <telerik:RadAjaxPanel ID="radajax" runat="server">
        <div style="width:auto">
            <div class="dvGridWrapper">
                    <asp:HiddenField ID="HFRecruit" runat="server" /><asp:HiddenField ID="HFId" runat="server" />
                    <asp:TextBox ID="txtSearch" runat="server" Width="260px" ToolTip="Enter Last Name First Name"></asp:TextBox>
                    <asp:TextBoxWatermarkExtender ID="txtSearch_WME" runat="server" TargetControlID="txtSearch" WatermarkText="Lookup Processor" WatermarkCssClass="Watermark"></asp:TextBoxWatermarkExtender>

    <div>
        <table  style="width:90%;margin-right:auto;margin-left:auto;margin-top:20px">               
            <tr>
                <td style="width:100%text-align:center">
                   <asp:HyperLink ID="hyEnlist" runat="server" onclick="LoadWindow(1)"><asp:Image ID="imgEnlist" runat="server" ImageUrl="../Images/SGT.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Non-Prior Service
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:HyperLink ID="hyPrior" runat="server" onclick="LoadWindow(1)"><asp:Image ID="imgPrior" runat="server" ImageUrl="../Images/Corp.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Prior Service
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:HyperLink ID="hyOfficer" runat="server" onclick="LoadWindow(2)"><asp:Image ID="imgOff" runat="server" ImageUrl="../Images/Cpt.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Basic Branch
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   <asp:HyperLink ID="HyWarrant" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgWarrant" runat="server" ImageUrl="../Images/W03.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Warrant
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:HyperLink ID="hyGNPS" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgGNPS" runat="server" ImageUrl="../Images/glossary.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Glossory Non Prior Service                  
                </td>
            </tr>
            <tr>
                <td style="padding-top:40pxtext-align:center">
                    <asp:HyperLink ID="hyIncentives" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgIncent" runat="server" ImageUrl="../Images/Incentive.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Incentive Credit
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:HyperLink ID="hySpec" runat="server" onclick="LoadWindow(4)"><asp:Image ID="imgSpec" runat="server" ImageUrl="../Images/EFM.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Specialty Branch
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<%--                    <asp:HyperLink ID="hyRFP" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgRFP" runat="server" ImageUrl="../Images/recruit.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Recruit Force Pool
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--%>
                    <asp:HyperLink ID="hyIST" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgIST" runat="server" ImageUrl="../Images/IST.png" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Interstate Transfer
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <asp:HyperLink ID="hyDSE" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgDSE" runat="server" ImageUrl="../Images/toy2.jpg" CssClass="change_opacity" /></asp:HyperLink>&nbsp;Direct Service Enlistment 
                </td>
            </tr>
        </table>
    <telerik:RadWindow ID="radDashboard" runat="server" InitialBehaviors="Reload" ShowContentDuringLoad="false" CenterIfModal="true" Modal="true" Behaviors="Close" ></telerik:RadWindow>
        </div>    
    </telerik:RadAjaxPanel>
</asp:Content>
Nencho
Telerik team
 answered on 15 Nov 2013
15 answers
251 views
Hi,

I am using the latest version of RadControls for ASP.NET Ajax and get the following error (using Firefox) when returning from a Usercontrol popup window (running ASP.NET on a German Windows XP).
Any hints would be greatly appreciated.

Thanks,
Stefan

The numeric part ('161.5') of '161.5px' cannot be parsed as a numeric part of a Pixel unit.

Stack Trace:

[FormatException: The numeric part ('161.5') of '161.5px' cannot be parsed as a numeric part of a Pixel unit.]
   System.Web.UI.WebControls.Unit..ctor(String value, CultureInfo culture, UnitType defaultType) +508
   System.Web.UI.WebControls.Unit.Parse(String s) +63
   Telerik.Web.UI.RadGrid.LoadClientState(Dictionary`2 clientState) +946
   Telerik.Web.UI.RadCompositeDataBoundControl.LoadPostData(String postDataKey, NameValueCollection postCollection) +193
   Telerik.Web.UI.RadCompositeDataBoundControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +42
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +693
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1743
Stef
Telerik team
 answered on 15 Nov 2013
3 answers
149 views
Hello Telerik Team,

we have a strange behavior after changing the ASP.NET AJAX Telerik Version from "2009.3.1103.35" to "2010.1.519.35":
 
We have a ASPX page, which opens a new RadWindow in Modal mode. This window is opened via "window.radopen(...)".
The RadWindow has also get declared a close event handler with "add_close(...)".

When the RadWindow closes, the calling page opens a new IE window with "window.open(...)" in the close event function and calls  "newWin.focus()" on the new window.  

The parent page is not reloaded at this point.


With the previous (old) Telerik Version, the new window was opened as expected and set to the front.

After updating the Telerik Version, the new window was already opened in the close event handler, but the focus did not get assigned to the new window. It seems, that the parent window is grabbing the focus back. Even with the JS calls:

Parent Page: self.blur(); newWindow.focus();
New Window Page: self.focus();

the new window is moved to the background.


Do you know of any issues when using the RadWindow in this way in the version as defined above?


Kind regards,
Johann
Marin Bratanov
Telerik team
 answered on 15 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?