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

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

3 Answers 647 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
SKY
Top achievements
Rank 1
SKY asked on 02 Nov 2010, 12:42 PM
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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Nov 2010, 02:16 PM
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.
0
SKY
Top achievements
Rank 1
answered on 02 Nov 2010, 06:31 PM
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
0
Princy
Top achievements
Rank 2
answered on 03 Nov 2010, 01:45 PM
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.
Tags
ComboBox
Asked by
SKY
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
SKY
Top achievements
Rank 1
Share this question
or