Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
138 views
I am getting this error in opening rad window :

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Timestamp: Tue, 26 Feb 2013 11:07:15 UTC

Message: Object expected
Line: 231
Char: 2
Code: 0
URI: http://aspnet-scripts.telerikstatic.com/ajaxz/2012.3.1308/Window/RadWindowScripts.js

Message: Object expected
Line: 231
Char: 2
Code: 0
URI: http://aspnet-scripts.telerikstatic.com/ajaxz/2012.3.1308/Window/RadWindowScripts.js

Message: Object expected
Line: 231
Char: 2
Code: 0
URI: http://aspnet-scripts.telerikstatic.com/ajaxz/2012.3.1308/Window/RadWindowScripts.js

Message: Object expected
Line: 231
Char: 2
Code: 0
URI: http://aspnet-scripts.telerikstatic.com/ajaxz/2012.3.1308/Window/RadWindowScripts.js

Code :

<div class="bitInput">
    <div class="btn btn-success btnAdd"  Style="width: 192px ! important;margin-top:10px;" onclick="OpenActionGrid();">Add a Proposed Action</div>
</div>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
</telerik:RadAjaxLoadingPanel>
<telerik:RadWindow ID="RWAction" OnClientClose="OnClientCloseProposedActionGrid" Width="350" Height="400" runat="server" Modal="true" Title="Proposed Actions"  VisibleOnPageLoad="false" Behaviors="Move,Close, Reload" EnableShadow="true">
  <ContentTemplate>
 
<div style="font-weight: bold; font-size: 14px;padding-left:0px !important;">
    
    <div>
        <div>
            <div>
                <asp:Label ID="lblActionType" CssClass="bitInputLabel" AssociatedControlID="cmbActionTypeInvPA" runat="server">Action Type:</asp:Label>
            </div>
            <div class="flt">
                <telerik:RadComboBox ID="cmbActionTypeInvPA" runat="server" Width="215px" Skin="Default" EmptyMessage="Select Action Type" OnClientSelectedIndexChanged="onSelectedIndexChanged">
                </telerik:RadComboBox>
                </div>
            <div  class="flt">
                <asp:RequiredFieldValidator runat="server" ID="reqActionTypePA" ValidationGroup="invActionValidation" SetFocusOnError="true"
                    ControlToValidate="cmbActionTypeInvPA" ErrorMessage="Current Control is required" Text="*"></asp:RequiredFieldValidator>
            </div>
            <div class="clr"></div>
            <div id="divActionTypeOtherPA" class="divActionTypeOtherPA" style="display: none; margin-top: 2px;" runat="server">
                <div class="flt">
                <telerik:RadTextBox ID="txtActionTypeOthersInvPA" runat="server" Width="217px" Skin="Default">
                </telerik:RadTextBox>
                </div>
                <div class="flt">
                <asp:RequiredFieldValidator runat="server" ID="rfvtxtActionTypeOthersPA" ValidationGroup="invActionValidation" ClientIDMode="Static" Enabled="false" SetFocusOnError="true"
                    ControlToValidate="txtActionTypeOthersInvPA" ErrorMessage="Responsibility is required" Text="*"></asp:RequiredFieldValidator>
                 </div>
                 <div class="clr"></div>
            </div>
        </div>
        <div>
            <div>
                <asp:Label CssClass="bitInputLabel" runat="server" ID="lblActions" AssociatedControlID="txtActionsPA">Proposed Actions</asp:Label>
            </div>
            <div class="flt">
                <telerik:RadTextBox ID="txtActionsPA" CssClass="textInput" runat="server" Width="217px" ValidationGroup="invActionValidation"></telerik:RadTextBox>
                </div>
            <div class="flt">
                <asp:RequiredFieldValidator runat="server" ID="reqActionsPA" ValidationGroup="invActionValidation" SetFocusOnError="true"
                    ControlToValidate="txtActionsPA" ErrorMessage="Action is required" Text="*"></asp:RequiredFieldValidator>
            </div>
              <div class="clr"></div>
        </div>
        <div>
            <div>
                <asp:Label ID="lblResponsibilityInv" runat="server" CssClass="bitInputLabel" AssociatedControlID="txtResponsibilityPA">Responsibility:</asp:Label>
            </div>
            <div class="flt">
                <telerik:RadTextBox ID="txtResponsibilityPA" EnableSingleInputRendering="true" ShowButton="true"  AutoPostBack="true" OnTextChanged="txtResponsibilityPA_TextChanged" CssClass="textInput" runat="server" Width="245px"></telerik:RadTextBox>
                <%--<telerik:RadTextBox ID="" CssClass="textInput" runat="server" Width="217px" ValidationGroup="invActionValidation"></telerik:RadTextBox>--%>
                </div>
            <div class="flt">
                <asp:RequiredFieldValidator runat="server" ID="reqResponsibilityPA" ValidationGroup="invActionValidation" SetFocusOnError="true"
                    ControlToValidate="txtResponsibilityPA" ErrorMessage="Responsibility is required" Text="*"></asp:RequiredFieldValidator>
            </div>
              <div class="clr"></div>
        </div>
        <div style="margin-top:5px;" >
             <telerik:RadTextBox ID="txtResponsibilityNamePA" CssClass="textInput" ReadOnly="true" runat="server" Width="224px"></telerik:RadTextBox>
        </div>
        <div>
            <div>
                <asp:Label ID="lblDueDateInv" CssClass="bitInputLabel" runat="server" AssociatedControlID="rdpDueDateInvPA">Due Date:</asp:Label>
            </div>
            <div class="flt">
                <telerik:RadDatePicker ID="rdpDueDateInvPA" runat="server" Width="217px" ValidationGroup="invActionValidation"></telerik:RadDatePicker>
                </div>
            <div class="flt">
                <asp:RequiredFieldValidator runat="server" ID="reqDueDateInvPA" ValidationGroup="invActionValidation" SetFocusOnError="true"
                    ControlToValidate="rdpDueDateInvPA" ErrorMessage="Due Date is required" Text="*"></asp:RequiredFieldValidator>
            </div>
            <div class="clr"></div>
        </div>
        <div class="clr"></div>
    </div>
<div style="margin-top: 5px;">
    <asp:Button ID="btnAddInvAction" runat="server" Text="Save" OnClick="btnInvAction_Click" CssClass="btn btn-primary btnAdd" ValidationGroup="invActionValidation" />
        <asp:Button ID="btnActionClose" runat="server" Text="Close" CssClass="btn btn-danger btnAdd" OnClientClick="CloseProposedAction();"  OnClick="btnActionClose_Click" />
       <asp:HiddenField ID="hdnProposedAction" runat="server" />
    </div>
</div>
 
      </ContentTemplate>
    </telerik:RadWindow>


js :

function OpenActionGrid() {
            $find("<%=RWAction.ClientID%>").show();
        }
Manali
Top achievements
Rank 1
 answered on 01 Mar 2013
1 answer
55 views
hello sir/ madam,

In this screen shot that i have attached i m using linkbutton named(Final Approval) on this button click i want to access configuration name and sell quantity name at client side but i am not getting this so please tell me how can i acheive this. i also have used

GridDataItem dataItem1 = (GridDataItem)grd_optnandprcng.SelectedItems[0];
  string configuration = dataItem1["Header"].Text;

but i am not getting value of column at button click.
Shinu
Top achievements
Rank 2
 answered on 01 Mar 2013
2 answers
122 views
Hi!

My Scenario:
I'm using the RadEditor control as an editor on a form that the user fills out to submit an Email.  The RadEditor is where the user types the body of the email.  We have some Email templates stored as HTML in our database that the user can select via a dropdown on the form.  The templates are full HTML having their own head tags and style tags with their own styles.

My Question:
Can I set the RadEditor content to the full HTML of my templates?  I would like to be able to set the content of the editor to the full HTML and be able to get the full HTML out of the RadEditor on the server code-behind.   I am currently trying to do this but when I use the .Content property of the editor, I'm only getting what is inside of the <body> tags, not the full HTML.   This is problematic when I need to save the editor content back to the database after the user has entered content, because I need to the full HTML to be saved to the database.  

Is my approach incorrect and instead should I be only trying to save and retrieve the body of the Editor's html, not the full html?  In that case, how would I deal with different styles that need to be applied for each my Email templates?

Please note that I've been using the  ContentAreaMode="Iframe" setting of the editor.

Thank you!!!

Yunier
Top achievements
Rank 1
 answered on 28 Feb 2013
2 answers
107 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
161 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
141 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
128 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
280 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
110 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
305 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?