Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
126 views
Hello,

In HTML Column Chart, I am trying to Make Y Axis Label Bold using

RadHtmlChart1.PlotArea.XAxis.LabelsAppearance.TextStyle.Bold = true;

but i am getting error line "TextStyle" is not supported under XAxis.LabelsAppearance

I have refered below link example
http://www.telerik.com/help/aspnet-ajax/htmlchart-appearance-labels-titles-font-settings.html,
it says it is supported.

Am i missing something?

Thanks,
Dhachina


Danail Vasilev
Telerik team
 answered on 28 Feb 2013
4 answers
182 views
Hi!

See attached...

I see that I can style the emphasized text using this:

.RadComboBoxDropDown .rcbItem em
{
    color: #000000 !important; /* App.Colors.FocusForeColor */ 
}


However, notice the hover changes the bold text back to the built-in style. I want it to also be black. I have tried a few things and can't get it to behave. What is the correct CSS to style this?

Thanks!
Michael
Michael O'Flaherty
Top achievements
Rank 2
 answered on 28 Feb 2013
1 answer
174 views
How is it possible to add a "custom" legend from code behind is it even possible to create a legend with my code  ? or should i do something else ? 

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HolidayTrackerEntities ctx = HtEntityFactory.Context;
 
            IEnumerable<HtUser> users = ctx.HtUsers;
          
            int year = 2013;
 
            double usedVacation = 0;
            double bookedVacation = 0;
 
            foreach (HtUser user in users)
            {
                usedVacation += user.GetUsedVacation(year);
                bookedVacation += user.GetBookedVacation(year);
            }
            double forcastVacation = usedVacation + bookedVacation;
 
            List<double> src = new List<double>();
            src.Add(usedVacation);
            src.Add(bookedVacation);
            src.Add(forcastVacation);
 
            VacationPieChart.DataSource = src;
            VacationPieChart.DataBind();
        }
    }

Thanks for help and fast answer !! 
Danail Vasilev
Telerik team
 answered on 28 Feb 2013
1 answer
141 views
Hello 
I used the instruction in the following linq 
But Instead I used Linq to Sql to load the Data 
I have 3 Columns Brand , Model and ProductID 
When I write the first character of Brand I can get the result but I need to get the query result for Model also 


For Example I will Write Microsoft it will list Microsoft or I will write Office 2007 then it will list Microsoft Office 2007
I have the following code 


<telerik:RadComboBox runat="server" ID="RadComboBox1" Height="190px" Width="420px"
            MarkFirstMatch="true"   EnableLoadOnDemand="true" 
            HighlightTemplatedItems="true"  OnItemsRequested="RadComboBox1_ItemsRequested" AutoPostBack ="False" >
            <HeaderTemplate>
                <ul>
                    <li class="col1">Model Name</li>
                    <li class="col2">Brand</li>
                    <li class="col3">Product ID</li>
                </ul>
            </HeaderTemplate>
            <ItemTemplate>
                <ul>
                    <li class="col1">
                        <%# DataBinder.Eval(Container.DataItem, "ModelName")%></li>
                    <li class="col2">
                        <%# DataBinder.Eval(Container.DataItem, "Brand")%></li>
                    <li class="col3">
                        <%# DataBinder.Eval(Container.DataItem, "ProductID")%></li>
                </ul>
            </ItemTemplate>
        </telerik:RadComboBox>


And This is Code Behind 

Protected Sub RadComboBox1_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
 
           
 
           
          Dim y = (From x In db.table_
          Where x.Manufacturer.Contains(RadComboBox1.Text)
                 Select New With {.Products = x.ModelName + " - " + x.Brand, _
                                  .ProductID = x.ProductID, .ModelName = x.ModelName, _
                                  .Manufacturer = x.Brand}).ToList
 
 
          RadComboBox1.DataSource = y
          RadComboBox1.DataTextField = "Products"
          RadComboBox1.DataValueField = "ProductID"
          RadComboBox1.DataBind()
      End Sub
      Protected Sub RadComboBox1_ItemDataBound(ByVal sender As Object, ByVal e As RadComboBoxItemEventArgs)
          'set the Text and Value property of every item
          'here you can set any other properties like Enabled, ToolTip, Visible, etc.
 
          e.Item.Text = (DirectCast(e.Item.DataItem, DataRowView))("ModelName").ToString()
          e.Item.Value = (DirectCast(e.Item.DataItem, DataRowView))("Brand").ToString()
      End Sub
 
      
  End Class



How Can I do that 

Hristo Valyavicharski
Telerik team
 answered on 28 Feb 2013
7 answers
302 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
139 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
328 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
101 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
93 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
129 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?