'System.Data.DataRowView' does not contain a property with the name ERROR

4 posts, 0 answers
  1. SKY
    SKY avatar
    14 posts
    Member since:
    Jun 2010

    Posted 02 Nov 2010 Link to this post

    Hi,

    I am using Telerik controls for displaying data.

    Inside the Telerik grid i have to show radcombobox.
    I have done this using Template column, but now i am trying the same using telerik GridDropDownColumn.
    For providing data to the grid, i am using a SQL data source and for populating dropdown i am using separate sql data source.
    I have tried two scenarios here:
    1) When the query to populate the dropdown is a subset of the main query to populate the rad grid. (In this case it was working good).
    2) When the query to populate the dropdown is coming from a different table, i am getting "'System.Data.DataRowView' does not contain a property with the name ERROR" in this case.

    I dont know if i am missing any property to set for the dropdown column.
    Below is the same code for this....

    <telerik:RadGrid ID="rgrdUpdateDropdown" runat="server" DataSourceID="dsDropDown" GridLines="None" Width="600px">
                <MasterTableView AutoGenerateColumns="False" EditMode="InPlace" DataSourceID="dsDropDown" DataKeyNames="COMM_CD">
                    <Columns>
                        <telerik:GridEditCommandColumn UniqueName="EDIT_IMAGE" ButtonType="LinkButton" EditText="Edit">
                            <ItemStyle Width="2%"/>
                        </telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn DataField="COMM_CD" HeaderText="ID" UniqueName="COMM_CD">
                        </telerik:GridBoundColumn>
                        <telerik:GridDropDownColumn DataSourceID="dsDropDown2" HeaderText="Editable" UniqueName="Dropdown1" DataField="POSSE_ADDR"
                            ListTextField="POSSE_ADDR" ListValueField="POSSE_ADDR" DropDownControlType="RadComboBox">
                        </telerik:GridDropDownColumn>
                        <telerik:GridDropDownColumn DataSourceID="dsDropDown"  HeaderText="Editable1" UniqueName="Dropdown12" DataField="COMM_CD"
                            ListTextField="COMM_CD" DropDownControlType="RadComboBox">
                        </telerik:GridDropDownColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
                    <asp:SqlDataSource ID="dsDropDown" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
                SelectCommand='SELECT "COMM_CD","COMM_NAME" FROM "COMMUNITY"'>
            </asp:SqlDataSource>
                    <asp:SqlDataSource ID="dsDropDown2" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
                SelectCommand='SELECT DISTINCT "POSSE_ADDR" FROM "ADDRESS" WHERE ROWNUM < 10'>
            </asp:SqlDataSource>

    Thanks
    SKY
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Nov 2010 Link to this post

    Hello,


    The error states that you missed adding System.Data Namespace in your code file.

    Add this code to include Namespace and see whether it solves:
               using System.Data;

    Thanks,
    Princy.
  3. SKY
    SKY avatar
    14 posts
    Member since:
    Jun 2010

    Posted 02 Nov 2010 Link to this post

    Hi Princy,

    This statement is present in my code file.
    One thing which i found is, in one of my bound column, the datafield specified is coming from the second sqldatasource, so it is throwing this exception that the dataview doesn't contain the column "columnname".
    Is there any way i can fix it?
    One alternative way was to remove the datafield from that column and assign that value in code, but in this approach also, i was facing some issue. There was no error coming in this approach but i was not able to see data in that column.
    If you have any idea doing it in any way, please reply.

    Thanks
    SKY
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 03 Nov 2010 Link to this post

    Hi,


    Please go through the folowing documentation which shows how to customize the GridDropDownColumn.
    Customize/Configure GridDropDownColumn

    Hope this will help you to get started.

    Thanks,
    Princy.
Back to Top