Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
284 views
I am using a custom appointment page to replace the advanced edit and insert form.  I use a webpage that pops up into a radwindow.  I am attempting to add reminders to the scheduler and I am following the example for "Scheduler / External Edit in RadDock" in the demo section for radscheduler.  My question is when I save the appointment to my database and I save the reminder from the dropdown should I just save the value as an integer or use something else.  I have seen in other examples that the reminder should be a nvarchar(255) and saving a lot of text.  Based of the demo what is the best way to save the reminder.

Let me know if more info is needed and please help when you can.

Also, I can get the reminders to popup but I have to have two reminders setup for it to work.  If I have only one reminder showing it will not popup.
Plamen
Telerik team
 answered on 28 Feb 2013
2 answers
113 views
Hello,

I'm hoping someone else has run into this problem.  I have a simple page with a treeview and a button.  The button calls code that exports the treeview to a .csv file.  If a node is expanded then I want to export the child nodes as well.  For some reason in code behind it is telling me that all nodes at level 1 are collapsed even though I expanded them before I clicked the export button.  Any ideas?

Thanks,
Casey
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TreeView.aspx.cs" Inherits="DXiCustomerData.TreeView" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadButton ID="btnExportTree" runat="server" Text="Export Tree" OnClick="btnExportTree_Click"
            Visible="true">
        </telerik:RadButton>
        <telerik:RadTreeView ID="rtvResults" runat="server" Visible="true">
        </telerik:RadTreeView>
    </div>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.IO;
using System.Collections;
using Telerik.Web;
using Telerik.Web.UI;
 
namespace DXiCustomerData
{
    public partial class TreeView : System.Web.UI.Page
    {
        private String glogDate;
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(Properties.Settings.Default.ConnectionString);
            rtvResults.Nodes.Clear();
            conn.Open();
            PopulateTree pt = new PopulateTree();
            pt.AddNodes(conn, rtvResults, Request.QueryString.Get("SN"));
            glogDate = pt.glogDate;
            conn.Close();
        }
 
        protected void btnExportTree_Click(object sender, EventArgs e)
        {
            string sFileName = System.IO.Path.GetRandomFileName();
            string sGenName = "DXiConfigInfo.csv";
 
            if (Request.QueryString.Get("SN") != null)
            {
                DateTime dt;
                DateTime.TryParse(glogDate, out dt);
                sGenName = "DXiConfigInfo_" + Request.QueryString.Get("SN") + "_LogDate_" + dt.ToString("yyyyMMddHHmm") + ".csv";
            }
            StreamWriter sw = new StreamWriter(Server.MapPath("TextFiles/" + sFileName + ".csv"), false, System.Text.Encoding.UTF8);
            exportToXml(sw, rtvResults);
            sw.Close();
 
            System.IO.FileStream fs = null;
            fs = System.IO.File.Open(Server.MapPath("TextFiles/" +
                     sFileName + ".csv"), System.IO.FileMode.Open);
            byte[] btFile = new byte[fs.Length];
            fs.Read(btFile, 0, Convert.ToInt32(fs.Length));
            fs.Close();
            Response.AddHeader("Content-disposition", "attachment; filename=" +
                               sGenName);
            Response.ContentType = "application/octet-stream";
            Response.BinaryWrite(btFile);
            Response.End();
        }
        public static void exportToXml(StreamWriter sr, RadTreeView parent)
        {
            foreach (RadTreeNode node in parent.Nodes)
            {
                sr.WriteLine(node.Text);
                if (node.Nodes.Count > 0 && node.Expanded)
                    parseNode(sr, node);
            }
        }
 
        private static void parseNode(StreamWriter sr, RadTreeNode parent)
        {
            foreach (RadTreeNode child in parent.Nodes)
            {
                for (int i = 0; i < child.Level; i++)
                    sr.Write(",");
                sr.WriteLine(child.Text);
                if (child.Nodes.Count > 0 && child.Expanded)
                    parseNode(sr, child);
            }
        }
    }
}
Casey
Top achievements
Rank 1
 answered on 28 Feb 2013
8 answers
309 views
I don't seem to be able to use the 4.5 "ItemType" "Item" property in my GridTemplateColumn

Now this is my first time trying it, but...does it work, am I doing this wrong?

<telerik:RadGrid ID="learnerGrid" runat="server" OnNeedDataSource="learnerGrid_NeedDataSource" AutoGenerateColumns="false" ShowHeader="true" Height="500px" ItemType="AuthDB.Model.MppProfile">
        <MasterTableView>
            <Columns>
                <telerik:GridTemplateColumn DataField="UserName" HeaderText="Name">
                    <ItemTemplate>
                        <span><%# Item.UserName %></span>
                        <span></span>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="FullNameReverse" HeaderText="Name" />
            </Columns>
            <NoRecordsTemplate>
                No learners
            </NoRecordsTemplate>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="true" ScrollHeight="500px" />
        </ClientSettings>
    </telerik:RadGrid>
Pavlina
Telerik team
 answered on 28 Feb 2013
1 answer
92 views
Why did the Sitefinity skin change from V 2012.3.1308.40 to V 2012.2.912.40? I thought these skins are standards that do not change.
Galin
Telerik team
 answered on 28 Feb 2013
0 answers
87 views
Hello,

I'm using a DotNetNuke 7.0 webservice and calling it from the autocomplete text box. I have a more complex version, but even this simple one isn't working:

<telerik:RadAutoCompleteBox runat="server" ID="test">
    <WebServiceSettings Method="AutocompleteSearchUsers"Path="http://localhost/DesktopModules/CoreServices/API/UserService" />
</telerik:RadAutoCompleteBox>

I am getting a result from the service that comes in XML - here's an example result I got from firebug:
<Items>
<AutoCompleteBoxItemData>
<Attributes xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"></Attributes>
<Enabled>true</Enabled>
<Text>Mike TEST Ryckman</Text>
<Value>22173</Value>
</AutoCompleteBoxItemData>
<AutoCompleteBoxItemData>
<Attributes xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"></Attributes>
<Enabled>true</Enabled>
<Text>Kirssa Cline Ryckman</Text>
<Value>29</Value>
</AutoCompleteBoxItemData>
<AutoCompleteBoxItemData>
<Attributes xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"></Attributes>
<Enabled>true</Enabled>
<Text>Kirssa Cline Ryckman</Text>
<Value>42</Value>
</AutoCompleteBoxItemData>
<AutoCompleteBoxItemData>
<Attributes xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"></Attributes>
<Enabled>true</Enabled>
<Text>Mike Ryckman</Text>
<Value>3</Value>
</AutoCompleteBoxItemData>
<AutoCompleteBoxItemData>
<Attributes xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"></Attributes>
<Enabled>true</Enabled>
<Text>Kirssa Ryckman</Text>
<Value>24</Value>
</AutoCompleteBoxItemData>
</Items>
</AutoCompleteBoxData>

Here's the method being called:

<DnnAuthorize()>
<HttpPost()>
Public Function AutocompleteSearchUsersTest(context As RadAutoCompleteContext) As AutoCompleteBoxData
    Const MaxRecords As Integer = 5
    Const MinLength As Integer = 2
    Dim serializer As New JavaScriptSerializer
    Dim data As Dictionary(Of String, Object)
    Dim searchString As String
 
    Try
        data = serializer.Deserialize(Of Dictionary(Of String, Object))(context("context").ToString)
        searchString = data("Text").ToString()
    Catch ex As Exception
        searchString = ""
    End Try
 
    Dim output As New AutoCompleteBoxData
    If searchString.Length >= MinLength Then
        Dim results As New List(Of AutoCompleteBoxItemData)
        Dim searchOutput As IEnumerable(Of UserInfo) = TestableUserController.Instance.GetUsersAdvancedSearch(PortalSettings.PortalId, UserController.GetCurrentUserInfo.UserID, -1, -1, -1, False, 0, 10, "LastName", True, "DisplayName", searchString).Take(MaxRecords)
 
        Dim curResult As AutoCompleteBoxItemData
 
        For Each curUser In searchOutput
            curResult = New AutoCompleteBoxItemData
            curResult.Text = curUser.DisplayName
            curResult.Value = curUser.UserID
            results.Add(curResult)
        Next
        output.Items = results.ToArray
    End If
    Return output
End Function

But, the autocomplete box doesn't populate or display results. When I look in the code, the UL (racList) doesn't get any items added to it and it never displays.

All of the exact same stuff works in both Chrome and IE. 

Any idea what's happening here? I noticed in the web service demo on your site that the results are in a JSON format...; could that be the problem?

Thanks,

Mike
Mike
Top achievements
Rank 1
 asked on 28 Feb 2013
1 answer
116 views

I have a page with SQL 2012 Report Viewer on it and using my global clientside error handling I get occassionally a popup telling me an error is occuring within the Telerik.Web.UI.WebResource.axd (attached). It is an Object Expected error. I have tried several things to eliminate, but have failed. Below is my html code for the page. I am only including parts of the master page. Note I had to use the UpdatePanel as the report viewer had issues with the Ajax Manager and it doing ajax calls.

Master Page

function Master_GlobalErrorHandler(message, errorURL, lineNumber) {
    var outputMessage = "An error occurred with the following details:\n\nMessage: " + message + "\nURL: " + errorURL + "\nLine Number: " + lineNumber + "\nUser Id: <%=lblLoggedInUser.Text %>\n\n\Please send this information to the help desk and the actions you were doing. Thank you.";
     
    $.ajax({
        type: "POST",
        url: "<%=(OlinCA.SalesCRM.Web.URLUtilities.GetAbsoluteURLBase() + OlinCA.SalesCRM.Web.URLUtilities.GetApplicationPath())%>Services/ErrorSendMail.asmx/SendMail",
        data: "{ 'FromAddress' : 'cawebmaster@olin.com', 'ToEmailAddresses' : ['jd1a@olin.com'] ,'Subject':'Sales CRM Client Side Error <%=System.Configuration.ConfigurationManager.AppSettings["CurrentRegion"].ToUpper() %>','Body':'" + outputMessage + "','ReplyTo':'cawebmaster@olin.com','IsBodyHtml':false}",
        contentType: "application/json; charset=utf-8",
        dataType: "json"}); 
    alert(outputMessage);
}
 
window.onerror = Master_GlobalErrorHandler;
$(document).ready(Master_InitializePage);

<form id="form1" runat="server">
 
<telerik:RadFormDecorator ID="rfdMasterPage" runat="server" RegisterWithScriptManager="true" />
<telerik:RadScriptManager ID="rsmMainScriptManager" runat="server">
    <Scripts>
        <%--Needed for JavaScript IntelliSense in VS2010--%>
        <%--For VS2008 replace RadScriptManager with ScriptManager--%>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
    </Scripts>
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="ramMainAjaxManager" runat="server" DefaultLoadingPanelID="ralpMainLoadingPanel" ClientEvents-OnRequestStart="ramMainAjaxManager_OnRequestStart"></telerik:RadAjaxManager>   
<telerik:RadAjaxLoadingPanel ID="ralpMainLoadingPanel" runat="server"></telerik:RadAjaxLoadingPanel>   
<telerik:RadAjaxLoadingPanel ID="ralpMainLoadingPanelDropDown" runat="server" Transparency="0" IsSticky="false" Skin="">
    <asp:Image ID="imgMainLoadingPanelDropDown" runat="server" ImageUrl="~/images/loading3.gif" ImageAlign="Bottom" />
</telerik:RadAjaxLoadingPanel>

Page With Report Viewer

<%@ Page Title="" Language="C#" MasterPageFile="~/Controls/SalesContract.Master" AutoEventWireup="true" CodeBehind="SalesContractReports.aspx.cs" Inherits="OlinCA.SalesCRM.Web.SalesContract.Reports.SalesContractReports" %>
 
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="cMainContent" ContentPlaceHolderID="cphPageContent" runat="server">
 
<table class="TableFullWidth" cellspacing="0" cellpadding="3" >
    <tr>
        <td>
            <asp:Label ID="lblSalesContractReporting_Title" runat="server" Text="Sales Contract Reporting" CssClass="PageTitle" ViewStateMode="Disabled" ></asp:Label>
        </td>
        <td align="right">
            <asp:Label ID="lblSalesContractReporting_ReportListingLabel" runat="server" Text="Choose Report to View:" CssClass="LabelBold"></asp:Label>
            <asp:DropDownList ID="ddlSalesContractReporting_ReportListing" runat="server"
                DataValueField="Name"
                DataTextField="Name"
                OnSelectedIndexChanged="ddlSalesContractReporting_ReportListing_SelectedIndexChanged"
                AutoPostBack="true"
                ViewStateMode="Enabled"
                EnableViewState="true"
                width="200px"></asp:DropDownList>
        </td>
    </tr>
</table>
<table class="TableFullWidth" cellspacing="0" cellpadding="3" >
    <tr>
        <td>
            <asp:UpdatePanel ID="upSalesContractReporting_ReportViewer" runat="server">
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="ddlSalesContractReporting_ReportListing" EventName="SelectedIndexChanged" />
                </Triggers>
                <ContentTemplate>
                <rsweb:ReportViewer ID="rvSalesContractReporting_ReportViewer" runat="server"
                    Font-Names="Verdana"
                    Font-Size="8pt"
                    WaitMessageFont-Names="Verdana"
                    WaitMessageFont-Size="14pt"
                    Width="100%"
                    Height="100%"
                    CssClass="ContentTableBordered">
                 </rsweb:ReportViewer>
                </ContentTemplate>
            </asp:UpdatePanel>
        </td>
    </tr>
</table>
</asp:Content>


Page With Report Viewer
Pavlina
Telerik team
 answered on 28 Feb 2013
5 answers
123 views
How can i set Scroll bars for Hierarchical grid
Pavlina
Telerik team
 answered on 28 Feb 2013
1 answer
131 views
Does anyone know how to add space between the chart and the datatable?
Kevin
Top achievements
Rank 2
 answered on 28 Feb 2013
1 answer
60 views
Hey All,

Yesterday I came across an issue with Radspell which I hope someone might be able to help me with. I am using the RadSpell but whenever I open and then close the checker multiply time the I get an error about a freed script. I pinpointed the error down to my theme which contains a theme for the Radwindow with ReloadOnShow sent to true, but if I set this to false the error doesn't appear.

Any ideas why this could be happening.

Thanks
Marin Bratanov
Telerik team
 answered on 28 Feb 2013
5 answers
99 views
1. It seems like this control is a much better replacement for the Asp.Net DropDownList than RadComboBox for lightweight use.  I was wondering if there will ever be methods on the items collection like FindByValue and FindByText like the standard asp.net control has?  I can easily find items using Linq on the Items collection, but thought it would be a built-in method.  RadComboBox has these methods, and although RadDropDown is lighter, these seem essential.

2.  Will there every be functionality that provides for auto-width on the drop down?  Since the asp.net listbox does this by default and the RadComboBox has this, it might be a nice addition.

I realize this is supposed to be a very lightweight control, but it seems to me these are pretty basic things...

Thanks,
Chris

 
Christopher Blickley
Top achievements
Rank 2
 answered on 28 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?