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

8 posts, 0 answers
  1. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 22 Jul 2008 Link to this post

    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
  2. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 22 Jul 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Todd Hile-Hoffer
    Todd Hile-Hoffer avatar
    19 posts
    Member since:
    Dec 2008

    Posted 23 Nov 2009 Link to this post

    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.
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 23 Nov 2009 Link to this post

    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.
  6. Todd Hile-Hoffer
    Todd Hile-Hoffer avatar
    19 posts
    Member since:
    Dec 2008

    Posted 23 Nov 2009 Link to this post

    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.
  7. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 23 Nov 2009 Link to this post

    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.
  8. Todd Hile-Hoffer
    Todd Hile-Hoffer avatar
    19 posts
    Member since:
    Dec 2008

    Posted 23 Nov 2009 Link to this post

    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;  
                }  
            } 

  9. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 27 Nov 2009 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017