Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
66 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
84 views
hii,
How can i expand a radtreenode on mouse over?

thanks..
Princy
Top achievements
Rank 2
 answered on 19 Oct 2012
2 answers
144 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
53 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
103 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
68 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
667 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
3 answers
80 views
Hi, I have a site that works fine in all the common desktop browsers but when viewed on the standard Browser that comes with Android 4 ICS on a tablet there are just spaces where the Rotator should be?I also tried it with the Dolphin Browser for Android, same results. I could not find anything in the documentation that states it does not work on Android? It works OK in iPhone/iPod.
Slav
Telerik team
 answered on 19 Oct 2012
3 answers
204 views

Hello.

I have a case:

1) User pastes a semicolon-separated list of entries into RadAutoCompleteBox;
2) Code must refine entries according to some logic and only add valid entries to Entries collection.

But it seems that the only case when I can modify RadAutoCompleteBox.Entries collection and my modifications are shown after postback is the initial load of a page. When I process 'paste' event on client via JavaScript and use __doPostBack(), any modifications to RadAutoCompleteBox.Entries are missed.

Here's a project reproducing the problem. When I paste, for example, "Most;are" (without quotes, assuming to paste two tokens: 'Most' and 'are'), nothing is added. If I comment out UpdatePanel it works as expected, but full page postback occurs.

MainPage.aspx


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="RC.ITRequest.UI.MainPage" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2012.2.1002.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" 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>
    <script type="text/javascript" src="jquery-1.8.2.min.js" ></script>
 
    <placeholder runat="server" >
        <script type="text/javascript">
            $(document).ready(function () {
                $(document).on('paste', 'input[name="' + '<%=RACB.ClientID %>'.replace('_', '$') + '"]', function (e) {
                    var el = $(this);
                    /* Just a small timeout till value can get populated */
                    setTimeout(function () {
                        // replace semicolon surrounded by sequences of space chars with single semicolon 
                        var text = $(el).val().replace(/ *; */g, ';');
                        __doPostBack('<%=RACB.ClientID %>', text);
                    }, 100);
                });
            });
        </script>
    </placeholder>
</head>
<body>
    <form id="form1" runat="server">
 
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>       
 
        <asp:UpdatePanel runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional" >
            <ContentTemplate>
                <telerik:RadAutoCompleteBox runat="server"
                                            ID="RACB"
                                            InputType="Token" />
            </ContentTemplate>
        </asp:UpdatePanel>
 
        <asp:Label runat="server" ID="lblLog" /><br/>
 
        <asp:Button Text="Press me to post back!"  runat="server" />
    </div>
 
    </form>
</body>
</html>

 

MainPage.aspx.cs

using System;
using System.Collections.Generic;
using Telerik.Web.UI;
 
namespace RC.ITRequest.UI
{
    public partial class MainPage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            List<string> adObjects = new List<string> {
                "Most",
                "of",
                "these",
                "pages",
                "are",
                "in",
                "the",
                "Afrikaans",
                "language",
                "spoken",
                "in",
                "South",
                "Africa"
            };
            RACB.DataSource = adObjects;
 
            if (Page.IsPostBack)
            {
                lblLog.Text += "<br/>__EVENTARGUMENT: '" + Request.Form["__EVENTARGUMENT"] + "'";               
                var newEntries = Request.Form["__EVENTARGUMENT"].Split(';');
                foreach (string newEntry in newEntries)
                {
                    RACB.Entries.Add(new AutoCompleteBoxEntry(newEntry, ""));
                }
            }
        }
    }
}

 

Ron
Top achievements
Rank 1
 answered on 19 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?