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

DataRowView does not contain a property with the name "Name"

7 Answers 142 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
David Penny
Top achievements
Rank 2
David Penny asked on 22 Jul 2008, 09:14 AM
Hi,

I have just updated to the Q1 2008 release of both ASP.NET Ajax and ASP.Net toolset.  I am going through a number of pages trying to update existing ASP.NET controls to ASP.NET Ajax controls and have succeeded with most, but the ComboBox is giving me a problem.

I have an Object datasource on a page (called dsProfession) which returns a simple datatable, and the ASP.NET combobox was linked to this OK.  When I change to ASP.NET Ajax combobox it does not like me just putting in the columns names from the Object datasource as it seems to want to validate them.

Is there any work around for this other than manually assigning the values when the page is opened?

The definition of the Combobox is:
<telerik:RadComboBox ID="ddlProfession" runat="server"   
AppendDataBoundItems="True" DataSourceID="dsProfession"   
DataTextField="Name" DataValueField="GroupRef"   
MarkFirstMatch="True" Skin="WindowsXP" Width="200px"   
AutoPostBack="True"   
ToolTip="Select a Profession for the fee quote line from the drop down list">  
<Items> 
   <telerik:RadComboBoxItem runat="server" Text="NONE" Value="-NONE-" /> 
</Items> 
</telerik:RadComboBox> 

and the definition for the Object datasource is:

<asp:ObjectDataSource ID="dsProfession" runat="server"   
SelectMethod="ListGroup" TypeName="dbGroup2  
CacheDuration="1800"   
OldValuesParameterFormatString="original_{0}">  
<SelectParameters> 
 <asp:Parameter DefaultValue="false" Name="ShowArchived" Type="Boolean" /> 
</SelectParameters> 
</asp:ObjectDataSource> 

David Penny
Pillar Software

7 Answers, 1 is accepted

Sort by
0
David Penny
Top achievements
Rank 2
answered on 22 Jul 2008, 09:34 AM
I think I may have answered my own question (again!?).

The problem appears to be at design time only.  When I compile and run the page displays my data values correctly.

David Penny
0
Todd Hile-Hoffer
Top achievements
Rank 2
answered on 23 Nov 2009, 02:22 PM
I use ObjectDataSources that return datatables and the rad comboboxes don't render in design. Did you ever come up with a fix for this or do you just tolerate it. The program works, but the busted design is annoying.
0
Simon
Telerik team
answered on 23 Nov 2009, 03:05 PM
Hello Todd Hile-Hoffer,

Are you receiving any Design-time errors? What are their descriptions saying?

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
Todd Hile-Hoffer
Top achievements
Rank 2
answered on 23 Nov 2009, 03:13 PM
The message says "There was an error rendering the control. TheDataTextField is neither a DataColumn nor a DataRelation for the table.  The datasource of the radComboBox is an ObjectDataSource that points to a class which returns a DataTable. The DataTable is not strongly typed.
0
Simon
Telerik team
answered on 23 Nov 2009, 03:17 PM
Hi Todd Hile-Hoffer,

Then you must make sure that the DataTextField property is set to the name of a column of the DataTable object that the RadComboBox is bound to.

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.
0
Todd Hile-Hoffer
Top achievements
Rank 2
answered on 23 Nov 2009, 03:20 PM

The program works, it just does not render in design mode. It is not a strongly typed data set. I guess the designer has no way to know the schema of the table.

The code for the data class method looks like this.

 [System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select)]  
        public  DataTable  ProductsWithBlank()  
        {  
            using (Buckeye.DataAccessLayer dal = new Buckeye.DataAccessLayer())  
            {  
                DataTable  result = dal.GetDataTable("dbo.Maintenance_GetProducts");   
                result.Rows.InsertAt(result.NewRow(), 0);  
                return result;  
            }  
        } 

0
Simon
Telerik team
answered on 27 Nov 2009, 02:18 PM
Hello Todd Hile-Hoffer,

Thank you for clarifying - I was missing the point until now.

I logged the issue in our bug-tracking system and updated your Telerik points for the report. Since we considered the issue as 'non-critical' it went at the end of the queue.

Sincerely yours,
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
David Penny
Top achievements
Rank 2
Answers by
David Penny
Top achievements
Rank 2
Todd Hile-Hoffer
Top achievements
Rank 2
Simon
Telerik team
Share this question
or