Hi:
I have a business layer that is returning Value and Text in a DataTable for all my combo-boxes in my application.
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
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> |
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
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.
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
Text
Value
Phil
0
Hi Phil,
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.
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:
Class in the app_code dir:
View in VS...
Phil
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> |
| 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
Hi Phil,
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.
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.