Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
69 views
just trying the HtmlChart from Version 2012.2.724.35 using a List DataSource and the sample code from the HtmlChart List demo.  While running the control in IE9, discovered this javascript error 

The Java Debug returns an error

Expected ']' at line



[-]  this._dataSource "[[{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45}]{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45},{\"MarketShare2010\":0.19,\"MarketShare2011\":0.45}]" 

It appears to be malformed. Any suggestions are appreciated
Cheers

Marin Bratanov
Telerik team
 answered on 19 Oct 2012
4 answers
119 views
I'm relatively new to Telerik, under a year, and everything has been going great so far, up until I installed Q3 yesterday - that's when the blank hit the fan!

My VS2010 did not crash like others reported, however, the minute I launched my website I had crash after crash dealing with my Master page - not 10 minutes before, under Q2, it worked perfectly!

I opened a ticket, sent the error info and other info to get to the bottom of it.

Then I decided to go back to Q2 so I uninstalled all Teleriks, got Q2 and installed it and thank heavens, when I launch my website, it does not crash and that's good.

But then I found this odd ball problem, if you look at the before and after attached jpgs you'll see when I call RadAlert() all of the RadTextboxes lose their style! After clicking OK on the RadAlert, you have to hover the mouse over each textbox to revert it back to the before jpg.

I need help with this problem (and this is while running Q2!). All of the other updates went really well too!

Thanks in advance!
Derek
Top achievements
Rank 1
 answered on 19 Oct 2012
0 answers
70 views
Hello,

[update: the title contains a typo: is not a wollbar, it's a toolbar]

I'm using the Toolbar with the metro touch skin.
I have a template tab with a textbox and a button inside of it. 
The textbox is aligned correctly but the button appears lower than the other controls.
Could you please let me know how to position the button on top aligment?
I already tried wrapping the content within a div like the following with no results:
<div style="vertical-align:top; height:40px">

Thanks,
javier
Top achievements
Rank 1
 asked on 19 Oct 2012
1 answer
88 views
hii,
How can i expand a radtreenode on mouse over?

thanks..
Princy
Top achievements
Rank 2
 answered on 19 Oct 2012
2 answers
148 views
Hi,
    Do we have any property or method that will hide or remove the "Spell check is complete" popup from the RadEditor..?? I saw that  we have a event(OnClientCheckFinished) in RadSpell that will do the above.But in my case im using RadEditor control(inbuilt spellcheck).Whether we have a property or we need to get the object of spellcheck from the RadEditor.If so, how to do it.Please help me on this requirement.


Thanks and Regards,
Jawahar
jawahar
Top achievements
Rank 1
 answered on 19 Oct 2012
1 answer
55 views
Hi!
I have a page that opens a radwindow with a radgrid.
When I click a row in the grid, I open another radwindow with the details.
When i save the details and close that second window, I want the grid to reload.

Both RadWindows are in a RadWindowManager on the main page, so any OnClientClose event ends up there.
Is there any way to access the first radwindow and refresh the grid from the parent page, or add a listener to it so it knows when the second window closes?
Robert
Top achievements
Rank 1
 answered on 19 Oct 2012
3 answers
107 views
Hi,

I have an ASPX page (WebReportGenerator.aspx) which contains an ASCX custom control (Palette.ascx). That custom control is in fact just a panel where I load some RadComboboxes dynamically based upon the results of a stored procs.

WebReportGenerator.aspx :
<body>
    <form id="formWebReportGenerator" runat="server" onmouseup="DisableDrag();" onmousemove="resizePanel();">
    <CustomControl:Palette ID="PaletteControl" runat="server">
    </CustomControl:Palette>
    </form>
</body>

The page_load of the WebReportGenerator just create some RadComboBoxes and ask to the CustomControl Palette to display them in an PlaceHolder.

WebReportGenerator.aspx.cs :
protected void Page_Load(object sender, EventArgs e)
      {
          GetSomeComboBoxes();
          PaletteControl.WebReportGeneratorView = this;
          PaletteControl.SetDimensionsPanel(ContextSelector);//ContextSelector is a class which contain some ComboBoxes
      }


As I said previously my custom control Palette.ascx have a Place Holder which is in an UpdatePanel.

Palette.ascx :
<asp:UpdatePanel runat="server">
    <ContentTemplate>
        <asp:PlaceHolder ID="DimensionsHolder" runat="server"></asp:PlaceHolder>
    </ContentTemplate>
</asp:UpdatePanel>

Here is what my SetDimensionsPanel function looks like :

Palette.ascx.cs:
internal void SetDimensionsPanel(ContextSelector contextSelector)
{
    foreach (var comboBox in contextSelector.HierarchicalComboBoxes.Values)
    {
        DimensionsHolder.Controls.Add(comboBox);
    }
}


The RadComboBoxes are in fact in a Custom User Control (ComboBoxView.ascx). Please look at the code lower.

ComboBoxView.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ComboBoxView.ascx.cs"
    Inherits="AS.Cpm.Web.Site.WebReportGenerator.Views.ComboBoxView" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<script type="text/javascript">
 
    function ClientNodeChecked_<%= ClientID %>(sender, eventArgs) {
        var node = eventArgs.get_node();
        var combo = $find("<%= RadComboBox.ClientID %>");
        var checkedNodes = sender.get_checkedNodes();
        var dimensionString = "";
        for (var i = 0; i < checkedNodes.length; i++) {
                dimensionString += checkedNodes[i].get_text();
            }
        combo.set_text(dimensionString);
        combo.attachDropDown();
    }
 
    function OnClientDropDownOpenedHandler_<%= ClientID %>(sender, eventArgs)
            {
                var tree = sender.get_items().getItem(0).findControl("RadTreeView1");
                var selectedNode = tree.get_selectedNode();
                if (selectedNode)
                {
                    selectedNode.scrollIntoView();
                }
            }
 
    function ClientNodeChecking_<%= ClientID %>(sender, eventArgs) {
        var node = eventArgs.get_node();
        var combo = $find("<%= RadComboBox.ClientID %>");
        var checkedNodes = sender.get_checkedNodes();
        for (var i = 0; i < checkedNodes.length; i++) {
                checkedNodes[i].set_checked(false);
            }
    }
 
    function ClientItemChecking_<%= ClientID %>(sender, eventArgs) {
        var combo = $find("<%= RadComboBox.ClientID %>");
        var node = eventArgs.get_item();
        var checkedItems = sender.get_checkedItems();
        for (var i = 0; i < checkedItems.length; i++) {
                checkedItems[i].set_checked(false);
            }
    }
</script>
<div id="DimensionLabelBgLeft"></div>
<div id="DimensionLabelBg"><asp:Label ID="Label" runat="server" CssClass="labelComboBox"></asp:Label></div>
<div id="DimensionLabelBgRight"></div>
<telerik:RadComboBox ID="RadComboBox" runat="server" HighlightTemplatedItems="True" AutoPostBack="true"
    AllowCustomText="true" ChangeTextOnKeyBoardNavigation="true" MaxHeight="200px"
    Width="100%">
</telerik:RadComboBox>

ComboBoxView.ascx.cs
public partial class ComboBoxView : System.Web.UI.UserControl
{
    protected List<RadTreeNode> radTreeNodes;
    protected List<RadComboBoxItem> radComboBoxItems;
    Boolean multiSelection;
 
 
    protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    /// <summary>
    /// Init hierarchical combobox
    /// </summary>
    /// <param name="entity">The entity</param>
    /// <param name="entityCode">The entity code</param>
    /// <param name="radTreeNodes">The tree nodes</param>
    /// <param name="multiSelection">true if it allows multi selection, else false</param>
    public void InitHierarchicalComboBox(String label, List<RadTreeNode> radTreeNodes, Boolean multiSelection = true)
    {
        this.radTreeNodes = radTreeNodes;
        setLabel(label);
        this.multiSelection = multiSelection;
    }
 
    /// <summary>
    /// Init non hierarchical combobox
    /// </summary>
    /// <param name="entity">The entity</param>
    /// <param name="entityCode">The entity code</param>
    /// <param name="radComboBoxItems">The combobox items</param>
    /// <param name="multiSelection">true if it allows multi selection, false else</param>
    public void InitNonHierarchicalComboBox(String label, List<RadComboBoxItem> radComboBoxItems, Boolean multiSelection = true)
    {
        this.radComboBoxItems = radComboBoxItems;
        setLabel(label);
        this.multiSelection = multiSelection;
    }
 
    /// <summary>
    /// Set the label of the combobox
    /// </summary>
    /// <param name="label">The text label</param>
    private void setLabel(String label)
    {
        Label.Text = label;
    }
 
    protected override void OnInit(EventArgs e)
    {
        var test = this;
        RadComboBox radComboBox = (RadComboBox)FindControl("RadComboBox");
        radComboBox.Items.Clear();
        radComboBox.OnClientDropDownOpened = "OnClientDropDownOpenedHandler_" + this.ClientID;
        if (radComboBox != null)
        {
            if (radTreeNodes != null)
            {                  
                radComboBox.ItemTemplate = new MyTreeView(this, radTreeNodes, multiSelection);
                radComboBox.Items.Add(new RadComboBoxItem(""));
                StringBuilder comboBoxText = new StringBuilder();
                foreach (var checkedNode in (radComboBox.ItemTemplate as MyTreeView).RadTreeView.CheckedNodes)
                    comboBoxText.Append(checkedNode.Text);
                radComboBox.Text = comboBoxText.ToString();
            }
 
        }
        base.OnInit(e);
    }
 
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        //Debug.WriteLine("**WRG diagnostics -> OnPreRender ComboBox : {0}", entity.Code);
        RadComboBox radComboBox = (RadComboBox)FindControl("RadComboBox");
        if (radComboBoxItems != null)
        {
            if (!multiSelection)
                radComboBox.OnClientItemChecking = "ClientItemChecking_" + this.ClientID;
            radComboBox.CheckBoxes = true;
            foreach (var radComboBoxItem in radComboBoxItems)
            {
                radComboBox.Items.Add(radComboBoxItem);
            }
        }
    }
 
 
    /// <summary>
    /// Return the checked item of the combobox
    /// </summary>
    /// <returns></returns>
    public String GetCheckedItemText()
    {
        RadComboBox radComboBox = (RadComboBox)FindControl("RadComboBox");
        if(radComboBox.Text != String.Empty)
            return radComboBox.Text;
        return null;
    }
}
 
/// <summary>
/// The treeview template for the HierarchicalComboBox
/// </summary>
public class MyTreeView : ITemplate
{
    RadTreeView radTreeView;
    public RadTreeView RadTreeView { get { return radTreeView; } }
    List<RadTreeNode> radTreeNodes;
    ComboBoxView hierarchicalComboBox;
    Boolean multiSelection;
 
    public MyTreeView(ComboBoxView hierarchicalComboBox, List<RadTreeNode> radTreeNodes, Boolean multiSelection)
    {
        this.radTreeNodes = radTreeNodes;
        this.hierarchicalComboBox = hierarchicalComboBox;
        this.multiSelection = multiSelection;
    }
 
    public void InstantiateIn(System.Web.UI.Control container)
    {
        radTreeView = new RadTreeView();
        radTreeView.CheckBoxes = true;
        radTreeView.OnClientNodeChecked = "ClientNodeChecked_" + hierarchicalComboBox.ClientID;
        if(!multiSelection)
            radTreeView.OnClientNodeChecking = "ClientNodeChecking_" + hierarchicalComboBox.ClientID;
        radTreeView.Nodes.AddRange(radTreeNodes);
        //radTreeView.NodeCheck += new RadTreeViewEventHandler(RadTreeView_NodeCheck);
        container.Controls.Add(radTreeView);
    }
}

Here is the code to create a ComboBoxView :
//Non hierarchical
ComboBoxView _hierarchicalComboBoxAge = (ComboBoxView)new UserControl().LoadControl("~/Controls/ComboBoxView.ascx");
_hierarchicalComboBoxAge.InitNonHierarchicalComboBox("", CreateSomeItems("Age"), false);
_hierarchicalComboBoxAge.ID = "Age" + "§" + "NotDefined";
comboBoxViews.Add(_hierarchicalComboBoxAge);
 
//Hierarchical
ComboBoxView _hierarchicalComboBoxTree = (ComboBoxView)new UserControl().LoadControl("~/Controls/ComboBoxView.ascx");
_hierarchicalComboBoxTree.InitHierarchicalComboBox("", CreateSomeNodes("Tree"), false);
_hierarchicalComboBoxTree.ID = "Tree" + "§" + "NotDefined";
comboBoxViews.Add(_hierarchicalComboBoxTree);

The problem :

When I first load the page everything is ok. I get my ComboBoxes in my ContextSelector object which is stored in the ViewState of the page and there is no Exception fired. On post back, I have to clear the placeholder and then add some different ComboBoxes. However on each postback I have an Exception :

Request URL
 
[12/10/2012 11:35:54] http://localhost:90/WindowsIntegratedWebSite/WebReportGenerator/Views/WebReportGeneratorView.aspx?ReportId=42
 
Exception Details
 
System.InvalidOperationException: Les contrôles de script ne peuvent pas être inscrits avant PreRender.
 
Source
 
System.Web.Extensions
 
Target Site
 
Void RegisterScriptControl[TScriptControl](TScriptControl)
 
Stack Trace
   Ã  System.Web.UI.ScriptControlManager.RegisterScriptControl[TScriptControl](TScriptControl scriptControl)
   Ã  Telerik.Web.UI.RadDataBoundControl.RegisterScriptControl()
   Ã  Telerik.Web.UI.RadDataBoundControl.ControlPreRender()
   Ã  Telerik.Web.UI.RadTreeView.OnPreRender(EventArgs e)
   Ã  System.Web.UI.Control.PreRenderRecursiveInternal()
   Ã  System.Web.UI.Control.AddedControl(Control control, Int32 index)
   Ã  AS.Cpm.Web.Site.WebReportGenerator.Views.MyTreeView.InstantiateIn(Control container) dans C:\dev\Cpm\CpmNet\WebSite\WebReportGenerator\Views\ComboBoxView.ascx.cs:ligne 157
   Ã  Telerik.Web.UI.ControlItemContainer.ApplyTemplate(ControlItem item)
   Ã  Telerik.Web.UI.ControlItemContainer.InitializeItem(ControlItem item)
   Ã  Telerik.Web.UI.ControlItem.SetItemContainer(ControlItemContainer itemContainer)
   Ã  Telerik.Web.UI.ControlItemCollection.OnInsertComplete(Int32 index, Object value)
   Ã  System.Web.UI.StateManagedCollection.InsertInternal(Int32 index, Object o)
   Ã  System.Web.UI.StateManagedCollection.System.Collections.IList.Add(Object value)
   Ã  System.Web.UI.StateManagedCollection.LoadAllItemsFromViewState(Object savedState)
   Ã  System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   Ã  System.Web.UI.Control.LoadChildViewStateByIndex(ArrayList childState)
   Ã  System.Web.UI.Control.LoadViewStateRecursive(Object savedState)
   Ã  System.Web.UI.Control.AddedControl(Control control, Int32 index)
   Ã  AS.Cpm.Web.Site.WebReportGenerator.Views.PaletteUserControl.SetDimensionsPanel(ContextSelector contextSelector) dans C:\dev\Cpm\CpmNet\WebSite\WebReportGenerator\Views\Palette.ascx.cs:ligne 60
   Ã  AS.Cpm.Web.Site.WebReportGeneratorView.Page_Load(Object sender, EventArgs e) dans C:\dev\Cpm\CpmNet\WebSite\WebReportGenerator\Views\WebReportGeneratorView.aspx.cs:ligne 169
   Ã  System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
   Ã  PageBase.OnLoad(EventArgs e) dans C:\dev\Cpm\CpmNet\WebSite\Code\PageBase.cs:ligne 180
   Ã  System.Web.UI.Control.LoadRecursive()
   Ã  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
Data
 
System.Collections.ListDictionaryInternal

The reason why I'm opening that thread here is because when I replace the ComboBoxes with simple Button, it works perfectly.

So does anyone know how to fix this or has a better solution to this?

Thanks.

Romain.
Ivana
Telerik team
 answered on 19 Oct 2012
1 answer
73 views
Hi
the average fucntion is showing average of a page in radgrid instead of average of whole grid. In all other places that I have used the average function:

FooterAggregateFormatString

 

="{0:n0}" Aggregate="Avg" DataType="System.Double"



It work fine. But in one grid alone. the average is showing for each page. I am not getting what is gone wrong in this grid.
Thanks in advance.


Found the solution, it was something is to do with grouping being denabled in the grid.
Eyup
Telerik team
 answered on 19 Oct 2012
6 answers
1.4K+ views
I have a radgrid with buttons on the first column that I don't want the user to sort or reorder.  I have sorting enabled and client-side reordering enabled.

How do I do this?

Thanks.
Sony Telkar
Top achievements
Rank 1
 answered on 19 Oct 2012
4 answers
677 views
<telerik:RadComboBox ID="ddlMyCombo" DataTextField="dev" DataValueField="devid" AllowCustomText="false"
                                                    runat="server" Filter="StartsWith" ExpandDirection="Down" />


user should not be able to type in custom text in the ComboBox. I set the allowcustomtext property to false but it did not work.
when user types in custom text and the form is saved, the combobox selected value is -1.

please help with a solution to this.
Az
Top achievements
Rank 1
 answered on 19 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?