Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
63 views
Hi All,

I have one application where i use many rad controls. Now i want to use the editor control too, but as i see in that version the editor control has issues. I can't export to PDF, or I can't change the toolbox pictures. In the new version I see so that this issue don't exists anymore. I tried to download the latest version from rad controls and use that dll, but then the other controls are working not. So the best solution would be if I could use for the rad editor the new dll, and for the other controls the old dll. This is possible? Is some opportunity to can get the editor in a separate dll? Can you help me how can I resolve this, or some workaround?

Thanks for you help
Elod Laszlo
Top achievements
Rank 1
 answered on 01 Dec 2009
2 answers
161 views
I tried to install RadControls Q3 2009 but get the following error when I run this code:
using System;  
using System.Runtime.InteropServices;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Xml.Serialization;  
using Microsoft.SharePoint;  
using Microsoft.SharePoint.WebControls;  
using Microsoft.SharePoint.WebPartPages;  
using Telerik.Web.UI;  
 
namespace WebPart1  
{  
    [Guid("d7ac1371-a8aa-447e-a721-0ab32fc667e8")]  
    public class WebPart1 : System.Web.UI.WebControls.WebParts.WebPart  
    {  
        public WebPart1()  
        {  
        }  
 
        protected override void CreateChildControls()  
        {  
            base.CreateChildControls();  
 
            // TODO: add custom rendering code here.  
            RadGrid rg1 = new RadGrid();  
 
            SPWeb web = SPContext.Current.Web;  
 
            SPList list = web.Lists[0];  
 
            rg1.DataSource = list.Items;  
            rg1.DataBind();  
 
            this.Controls.Add(rg1);  
        }  
    }  
} 

Here is the error I get:
The type 'System.Web.UI.IScriptControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.   

The error seems to be that I dont have version 3.5.0.0 of the System.Web.Extensions dll.  Ok fair enough, but I thought to get
this version you'd have to download Ajax Extension from asp.net and it would create a folder in the path C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions with a new 2.0 folder?  All I seem to have is a folder v1.0.61025, in this folder is a System.Web.Extensions.dll version 1.0.61231.0.  Where do you get this 3.5.0.0 version?

Jason
Svetlina Anati
Telerik team
 answered on 01 Dec 2009
16 answers
418 views
I am trying to build this exact same example using a custom server control. Everything seems to be working fairly well other than being able to get the value back after submit from the combo box.

Here is the code for the server control...

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Web.UI; 
using System.Web.UI.HtmlControls; 
using System.Web.UI.WebControls; 
using LO.Persistence; 
using LO.Persistence.Services; 
using Telerik.Web.UI; 
using LO.Extensions; 
using LO.Web.ComponentModel; 
 
namespace LO.Web.UI.Controls 
{ 
    [BindingProperty("SelectedValue")] 
    public class OComboSelector : CompositeControl, IOControl 
    { 
        #region Properties 
         
        private RadComboBox _comboBox; 
        private RadTreeView _treeView; 
        private OLabel _label; 
        private bool _isPropertyChanged; 
        private bool _isSelectedValueChanged; 
 
        public T GetSelectedValue<T>() where T : IEntity, new() 
        { 
            if (_comboBox == null) 
            { 
                return ConvertExtension.ConvertTo<T>(string.Empty); 
            } 
            return ConvertExtension.ConvertTo<T>(_comboBox.SelectedValue); 
        } 
        public string SelectedText 
        { 
            get { return ViewState.GetValue("SelectedText", String.Empty); } 
            set 
            { 
                EnsureChildControls(); 
                RadTreeNode node = GetNodeByText(_treeView.Nodes, value); 
                if (node != null) 
                { 
                    node.Selected = true; 
                    _comboBox.Items[0].Text = value; 
                    _comboBox.Items[0].Selected = true; 
                    _comboBox.Text = value; 
                    _comboBox.SelectedValue = node.Value; 
                    ViewState["SelectedValue"] = node.Value; 
                    ViewState["SelectedText"] = value; 
                    OnSelectedValueChanged(new RadTreeNodeEventArgs(node)); 
                } 
            } 
        } 
        public string SelectedValue 
        { 
            get { return ViewState.GetValue("SelectedValue", String.Empty); } 
            set 
            { 
                EnsureChildControls(); 
                RadTreeNode node = GetNodeByValue(_treeView.Nodes, value); 
                if (node != null) 
                { 
                    node.Selected = true; 
                    _comboBox.Items[0].Text = node.Text; 
                    _comboBox.Items[0].Selected = true; 
                    _comboBox.Text = node.Text; 
                    _comboBox.SelectedValue = node.Value; 
                    ViewState["SelectedValue"] = value; 
                    ViewState["SelectedText"] = node.Text; 
                    OnSelectedValueChanged(new RadTreeNodeEventArgs(node)); 
                } 
            } 
        } 
        public override void DataBind() 
        { 
            _treeView.DataBind(); 
            base.DataBind(); 
        } 
        public String EmptyMessage 
        { 
            get { EnsureChildControls(); return _comboBox.EmptyMessage; } 
            set { EnsureChildControls(); _comboBox.EmptyMessage = value; } 
        } 
        public String DataFieldID 
        { 
            get { EnsureChildControls(); return _treeView.DataFieldID; } 
            set { EnsureChildControls(); _treeView.DataFieldID = value; } 
        } 
        public String DataTextField 
        { 
            get { EnsureChildControls(); return _treeView.DataTextField; } 
            set { EnsureChildControls(); _treeView.DataTextField = value; } 
        } 
        public String DataValueField 
        { 
            get { EnsureChildControls(); return _treeView.DataValueField; } 
            set { EnsureChildControls(); _treeView.DataValueField = value; } 
        } 
        public String DataFieldParentID 
        { 
            get { EnsureChildControls(); return _treeView.DataFieldParentID; } 
            set { EnsureChildControls(); _treeView.DataFieldParentID = value; } 
        } 
        public bool AutoPostBack 
        { 
            get { EnsureChildControls(); return _comboBox.AutoPostBack; } 
            set {  
                EnsureChildControls();  
                _comboBox.AutoPostBack = value; 
                if (value == true) 
                { 
                    _treeView.NodeClick += _treeView_NodeClick; 
                } 
            } 
        } 
        public object DataSource 
        { 
            get { EnsureChildControls(); return _treeView.DataSource; } 
            set { EnsureChildControls(); _treeView.DataSource = value; } 
        } 
        public bool Required 
        { 
            get { return ViewState.GetValue("Required", false); } 
            set { ViewState["Required"] = value; } 
        } 
        public bool ReadOnly 
        { 
            get { return ViewState.GetValue("ReadOnly", false); } 
            set { ViewState["ReadOnly"] = value; } 
        } 
        public string LabelID 
        { 
            get { return ViewState.GetValue("LabelID", string.Empty); } 
            set { ViewState["LabelID"] = value; } 
        } 
        public OLabel Label 
        { 
            get 
            { 
                if (_label == null) 
                { 
                    _label = ControlUtil.FindLabel(this); 
                } 
                return _label; 
            } 
        } 
        public string Property 
        { 
            get { return ViewState.GetValue("Property", string.Empty); } 
            set { ViewState["Property"] = value; } 
        } 
 
        public bool IsPropertyChanged 
        { 
            get { return _isPropertyChanged; } 
        } 
        public bool IsSelectedValueChanged 
        { 
            get { return _isSelectedValueChanged; } 
        } 
        public IEntity BindingSource 
        { 
            get; 
            set; 
        } 
        public string SecurityKey 
        { 
            get { return ViewState.GetValue("SecurityKey", string.Empty); } 
            set { ViewState["SecurityKey"] = value; } 
        } 
        #endregion 
        #region Events 
 
        public event EventHandler<RadTreeNodeEventArgs> SelectedValueChanged; 
        public void OnSelectedValueChanged(RadTreeNodeEventArgs e) 
        { 
            EventHandler<RadTreeNodeEventArgs> handler = SelectedValueChanged; 
            if (handler != null) handler(this, e); 
 
            _isSelectedValueChanged = true; 
        } 
        public event EventHandler<PropertyChangedEventArgs> PropertyChanged;      
        private void OnPropertyChanged(PropertyChangedEventArgs e) 
        { 
            EventHandler<PropertyChangedEventArgs> handler = PropertyChanged; 
            if (handler != null) handler(this, e); 
 
            _isPropertyChanged = true; 
        } 
        #endregion 
        #region Methods 
         
        private RadTreeNode GetNodeByValue(RadTreeNodeCollection nodes, string value) 
        { 
            EnsureChildControls(); 
            RadTreeNode returnNode = null; 
            foreach (RadTreeNode node in nodes) 
            { 
                if (node.Value == value) 
                { 
                    returnNode = node; 
                    break; 
                } 
                if (node.Nodes.Count > 0) 
                { 
                    node.Expanded = true; 
                    returnNode = GetNodeByValue(node.Nodes, value); 
                } 
            } 
            return returnNode; 
        } 
        private RadTreeNode GetNodeByText(RadTreeNodeCollection nodes, string value) 
        { 
            EnsureChildControls(); 
            RadTreeNode returnNode = null; 
            foreach (RadTreeNode node in nodes) 
            { 
                if (node.Text == value) 
                { 
                    returnNode = node; 
                    break; 
                } 
                if (node.Nodes.Count > 0) 
                { 
                    node.Expanded = true; 
                    returnNode = GetNodeByText(node.Nodes, value); 
                } 
            } 
            return returnNode; 
        } 
        protected override void CreateChildControls() 
        { 
            _comboBox = new RadComboBox { ID = "InternalComboBox", Width = Width }; 
            _treeView = new RadTreeView { ID = "TreeView" }; 
             
            RadComboBoxItem container = new RadComboBoxItem(); 
            HtmlGenericControl panel = new HtmlGenericControl("div"); 
 
            Controls.Add(_comboBox); 
            _comboBox.Items.Add(container); 
            container.Controls.Add(panel); 
            panel.Controls.Add(_treeView); 
             
            
            panel.ID = "itemTemplate"; 
            _comboBox.OnClientDropDownOpened = "_onClientDropDownOpenedHandler"; 
            _treeView.OnClientNodeClicking = "_nodeClicking"; 
 
            base.CreateChildControls(); 
        } 
        protected override void Render(HtmlTextWriter writer) 
        { 
 
            base.Render(writer); 
        } 
        private void _treeView_NodeClick(object sender, RadTreeNodeEventArgs e) 
        { 
            SelectedValue = ((RadTreeView)sender).SelectedNode.Value; 
            OnSelectedValueChanged(e); 
        } 
        public void Bind() 
        { 
            DataBindingUtil.Bind(this, "SelectedValue"); 
        } 
        public void Unbind() 
        { 
            DataBindingUtil.Unbind(this, "SelectedValue"); 
        } 
        protected override void OnInit(EventArgs e) 
        { 
            base.OnInit(e); 
        }       
        #endregion   
    } 
} 

Here is how I'm putting it on a page...

<lo:OComboSelector runat="server" ID="testing" /> 

This is the javascript on the page... (and I know for sure that all the control ID's are correct and getting the control it should)

<script type="text/javascript"> 
 
    function _nodeClicking(sender, args) { 
        var comboBox = $find("ctl00_ctl00_PageContentPlaceHolder_LeftContentPlaceHolder_eventForm_testing_InternalComboBox"); 
        var node = args.get_node(); 
        comboBox.set_text(node.get_text()); 
        comboBox.trackChanges(); 
        comboBox.get_items().getItem(0).set_value(node.get_value()); 
        comboBox.commitChanges(); 
        comboBox.hideDropDown(); 
    } 
 
    function _stopPropagation(e) { 
        if (!e) { 
            e = window.event; 
        } 
        e.cancelBubble = true; 
    } 
 
    function _onClientDropDownOpenedHandler(sender, eventArgs) { 
        var tree = sender.get_items().getItem(0).findControl("ctl00_ctl00_PageContentPlaceHolder_LeftContentPlaceHolder_eventForm_testing_InternalComboBox_i0_TreeView"); 
        var selectedNode = tree.get_selectedNode(); 
        if (selectedNode) { 
            selectedNode.scrollIntoView(); 
        } 
    } 
    var templatedd = document.getElementById("ctl00_ctl00_PageContentPlaceHolder_LeftContentPlaceHolder_eventForm_testing_InternalComboBox_i0_itemTemplate"); 
    templatedd.onclick = _stopPropagation; 
</script> 


This is my aspx page's code behind....

        protected void Page_Load(object sender, EventArgs e)  
        { 
            if (!IsPostBack) 
            { 
                testing.DataSource = toolTypes; 
                testing.DataTextField = "Name"; 
                testing.DataValueField = "ToolTypeID"; 
                testing.DataBind(); 
                testing.SelectedValue = "29"; 
            } 
            testing.EmptyMessage = "Please select something"; 
            Response.Write(testing.SelectedText); 
        } 
 

On first page load, I do get the selected text to response write correctly, but when I select something different from the treeview and click the submit button, I don't get the different value, I just get the same one. I'm thinking this has something to do with the javascript block below. If I put "_treeView.NodeClick += _treeView_NodeClick;" in the CreateChildControls() function, it works, but it causes postback every time the node is selected, and it's one postback behind with the correct value...Any ideas?
comboBox.trackChanges();
comboBox.get_items().getItem(0).set_value(node.get_value());
comboBox.commitChanges();
Simon
Telerik team
 answered on 01 Dec 2009
3 answers
154 views

Hi

I am having a RADMenu in which i am having many items.
RadMenu.DefaultGroupSettings.Height = Unit.Pixel(100) property set in order to fix scroll after that hieght.

After i  hide some top items in JS my other items are hanged in space.

Find attached Screen shot.


Thanks
Sumit Mittal

Yana
Telerik team
 answered on 01 Dec 2009
1 answer
138 views
Hi,

I am doing row selection to post back to the code behind with.
<ClientSettings EnableRowHoverStyle="true"  EnablePostBackOnRowClick="true" >                                 
            <Selecting AllowRowSelect="True" />                                                 
        </ClientSettings> 

The issue I have is in my left column I have a template checkbox column that I have the users to select.  If they miss the checkbox just slightly then it causes the grid to postback.  Is there a way to disable a column from causing a OnRowClickPostBack?  I'm aware of how to get javascript events to fire on the row click, but the event args.set_cancel() is for only the client side and doesn't prevent the postback.

Thanks


Shinu
Top achievements
Rank 2
 answered on 01 Dec 2009
2 answers
194 views
I have a RadGrid in which the contents and column settings are dictated by a dropdownlist.

When a dropdownlist item is selected, the grid's data and various configurable grid settings (like reordering, sorting, filtering, and column widths) are loaded from the database.  The user can then manipulate various settings client-side and optionally save them out again.

  • When an Ajax postback occurs, like refreshing the grid, the settings are maintained by the viewstate as usual.  For instance, if the user has changed the column width, that is maintained, no problem.

  • However, when the dropdownlist selection changes, causing a totally new set of data and settings to be loaded, any viewstate settings for the old data must be abandoned.  The solution we tried was overriding LoadViewState to do nothing in this case, but we get a NullReferenceException from RadGrid.LoadClientState if a column is resized and then the dropdownlist selection is changed.  If no columns have been resized, it works.  Also, column-resizing seems to be the only setting for which the exception happens (that I've found so far).

Do you have any suggestions here, either a better way to clear the grid's viewstate on a new data load, or perhaps a workaround for the resizing issue?

Thanks very much,
Eve



Eve Cunning
Top achievements
Rank 1
 answered on 01 Dec 2009
1 answer
142 views
Hello Friends,

i am using inline editing, during insert a record that time i would like to validate entered email address is valid or not using javascipt, waiting for your reply.



Thanks & Regards,
Amit Prajapati
Princy
Top achievements
Rank 2
 answered on 01 Dec 2009
1 answer
166 views
Hi Telerik Team,

                           I am using AJAX RadScheduler control in my app's. It's working fine and it is a bery good control. I am getting a exception in my app's which is pasted below can u please give me a solution for that and if possible send me a sample application which should be able to bind all appointments dynamically with customizing Appointment window where i can add additional fields to the appointment advanced insert/edit window.


 

Server Error in '/Apps' Application.

Value cannot be null.
Parameter name: expression

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: expression

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: expression]
   System.Web.UI.DataBinder.Eval(Object container, String expression) +8660271
   Telerik.Web.UI.Scheduling.DataSourceViewSchedulerProvider.GetAppointments(RadScheduler owner) +1923
   Telerik.Web.UI.RadScheduler.PerformSelect() +299
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.RadScheduler.EnsureDataBound() +93
   System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22
   Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) +36
   Telerik.Web.UI.RadScheduler.OnPreRender(EventArgs e) +131
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842



























Thanks in Advance,

K RAMU
Peter
Telerik team
 answered on 01 Dec 2009
1 answer
178 views
Hi,

I am using Q2 2009 version. 

Can you please click on the following click. In this link country word is diaplayed on each entry.
http://demos.mcmscontrols.com/ASPNET/Grid/Examples/Programming/GroupBy/DefaultCS.aspx.

Similar to this example, in my page there is word "Title:" which is displayed on each entry. How to remove this word.       

E.g     Title: Abc
           Title: XYZ
           Title: Test.

Please give me the solution ASAP.

Regards

Gaurish

Yavor
Telerik team
 answered on 01 Dec 2009
1 answer
81 views
Problem:
If there are about 15 appointments at the same time and we need to show all the subject of appointments in weekview, we cannot achieve it. Please see the attached snapshot.

Is there anyway we can customize the column for weekview?

I've tried with ColumnWidth but it is affecting all the columns as well as the columns where there is no appointment. So I need the column to be wider where there are multiple appointments and can show the subject (in a readable form).

Please help us as this is very important for our client.

Thanks
Rajesh
Peter
Telerik team
 answered on 01 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?