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

[Solved] There was an error rendering the control.

5 Answers 212 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 2
Phil asked on 03 Jan 2010, 01:26 AM
Hi:

I have a business layer that is returning Value and Text in a DataTable for all my combo-boxes in my application.
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"  
    SelectMethod="AccountNumber" TypeName="Aplic.BLL.DropDowns"
</asp:ObjectDataSource> 
<telerik:RadComboBox ID="RadComboBox1" runat="server"  
    DataSourceID="ObjectDataSource1" DataTextField="Text" DataValueField="Value"
</telerik:RadComboBox> 
 
In the designer it is always displaying:
  RadComboBox1
  There was an error rendering the control.
  Text is neither a DataColumn nor a DataRelation for table.
How can I solve this design time issue.
Phil

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Jan 2010, 07:43 AM
Hi Phil,

Could you specify the DataColumns used in your table?

-Shinu.
0
Phil
Top achievements
Rank 2
answered on 06 Jan 2010, 02:21 AM
2 columns
Text
Value

Phil
0
Simon
Telerik team
answered on 06 Jan 2010, 10:54 AM
Hi Phil,

Please also make sure that the objects returned by the AccountNumber method have Text and Value properties.

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Phil
Top achievements
Rank 2
answered on 08 Jan 2010, 01:02 AM
Hi
I have a little demo.  The web form:
<%@ Page Language="C#" %> 
<%@ 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"> 
<script runat="server"
</script> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title> Combo Box Render Problem</title> 
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadComboBox ID="radcomboboxDisplay" runat="server" Width="300px"  
            AutoPostBack="True" HighlightTemplatedItems="True"  
            CausesValidation="False"  
            Skin="Office2007" DataSourceID="dropdownDataSource" 
            DataTextField="Text" DataValueField="Value"
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </telerik:RadComboBox> 
        <asp:ObjectDataSource ID="dropdownDataSource" runat="server"  
            EnableCaching="True" TypeName="DropDowns" SelectMethod="dd"
        </asp:ObjectDataSource> 
    </div> 
    </form> 
</body> 
</html> 
 
Class in the app_code dir:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Data; 
public class DropDowns 
    public DataTable dd() 
    { 
        DataTable _return = new DataTable(); 
        _return.Columns.Add("Value", typeof(string)); 
        _return.Columns.Add("Text", typeof(string)); 
        _return.Rows.Add(new Object[] { "V1", "Text 1" }); 
        _return.Rows.Add(new Object[] { "V2", "Text 2" }); 
        _return.Rows.Add(new Object[] { "V3", "Text 3" }); 
        return _return; 
    } 
 

View in VS...
Phil
0
Simon
Telerik team
answered on 12 Jan 2010, 05:40 PM
Hi Phil,

Thank you for the code.

It turns out that our controls do not handle this case. In contrast, a standard ASP.NET TreeVew shows some fictional data when bound to the same ObjectDataSource.

Perhaps we will consider making our controls behave in the same way instead of throw an exception in the future.

All the best,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Phil
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Phil
Top achievements
Rank 2
Simon
Telerik team
Share this question
or