This is a migrated thread and some comments may be shown as answers.

TreeView in RadComboBox Issues

3 Answers 69 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 11 Apr 2011, 06:18 PM
Hello,

I am trying to use the treeview in the RadComboBox: http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/treeviewcombobox/defaultcs.aspx?product=combobox

I'm having two issues I can't figure out why:

1. The text of the item isn't changing when disabled.  When the control is disabled to prevent the user from changing the value, the value is not changing when set from server-side code.  I have rcbCode.Items[0].Text = "New Value", but the old value still appears.
2. Initially, when hitting the drop down the first time, the drop down is pretty small, but later on it returns to the correct size.  I am explicitly setting a CSS class for the drop down at 500px, but the first time it drops down to 200px.

Any ideas why?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 14 Apr 2011, 03:16 PM
Hello Brian,

Please verify, if you experience the same problems on the sample test page provided.

If I'm missing something in your scenario, please open a support ticket and provide us with sample project so we could examine it locally.

Regards,
Dimitar Terziev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Brian Mains
Top achievements
Rank 1
answered on 14 Apr 2011, 04:30 PM
Hello,

I was able to reproduce the issue with the following code.  Set in the markup Enabled="false", and replace your code-behind with:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;


public partial class Default42 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {


    }

    protected void Button1_Click(object sender, EventArgs e)
    {
var tree = RadComboBox1.Items[0].FindControl("RadTreeView1") as RadTreeView;
tree.FindNodeByText("Nairobi").Selected = true;

RadComboBox1.Items[0].Text = "Nairobi";
    }

protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);

var tree = RadComboBox1.Items[0].FindControl("RadTreeView1") as RadTreeView;
tree.FindNodeByText("Cape Town").Selected = true;

RadComboBox1.Items[0].Text = "Cape Town";

}
}

And you'll get the issue.

HTH.
0
Dimitar Terziev
Telerik team
answered on 19 Apr 2011, 03:58 PM
Hi Brian,

The problem you are experiencing is due to the fact that the OnPreRender event is fired after the OnClick event of the button and thus you overwrite the change made in the OnClick event. This is why you always have "Cape Town" selected in your treeview.

Regards,
Dimitar Terziev
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
ComboBox
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Brian Mains
Top achievements
Rank 1
Share this question
or