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

Error

1 Answer 60 Views
Grid
This is a migrated thread and some comments may be shown as answers.
johnson lim
Top achievements
Rank 1
johnson lim asked on 04 Mar 2011, 08:54 AM
HI ,
I encounter this error  when i want my embeded radcombox box to show the previous selected value in RadGrid.
The error message is as below:
DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'DataValue'. where DataRule is the value i pass in.

Below is my coding:
   <ajax:RadGrid ID="rgdRptAct" runat="server" DataSourceID="sqlCust" AutoGenerateColumns="false" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowPaging="true" PageSize="3">
       <SortingSettings SortToolTip="<%$ Resources:Resource, Sort %>" />
       <ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick="true">
           <Selecting AllowRowSelect="True" />
       </ClientSettings>
       <MasterTableView EditMode="InPlace" DataKeyNames="Cno,CustPrefix,Action" CommandItemDisplay="Top" AllowSorting="True" NoMasterRecordsText="<%$ Resources:Resource, Search_Display %>">  
           <PagerStyle Mode="NextPrevAndNumeric" PagerTextFormat="{2}{3}{4}Page {0} of {1}" PageSizeLabelText="" AlwaysVisible="true" NextPageToolTip="<%$ Resources:Resource, NextPage %>"  PrevPageToolTip="<%$ Resources:Resource, PreviousPage %>" LastPageToolTip="<%$ Resources:Resource, LastPage %>" FirstPageToolTip="<%$ Resources:Resource, FirstPage %>"/>
 <Columns>
              <ajax:GridTemplateColumn UniqueName="Action" HeaderText="* Action" SortExpression="LMUser" HeaderStyle-Width="140px" ItemStyle-VerticalAlign="Top">
                   <ItemTemplate>
                       <%#DataBinder.Eval(Container.DataItem, "Action")%> 
                   </ItemTemplate>
                   <EditItemTemplate>
                           <ajax:RadComboBox ID="DdlAction" runat="server" AutoPostBack="False" AllowCustomText="False"  DataSourceID="sqlDllAction"
                           AppendDataBoundItems="true"
                           DataTextField="DataValue"
                           DataValueField="DataValue" 
                           SelectedValue='<%# DataBinder.Eval(Container.DataItem, "DataValue") %>'>
                         
                           </ajax:RadComboBox>
                    
                   </EditItemTemplate>
               </ajax:GridTemplateColumn>
 
</Columns>
Can someone please advice what have i miss out here.
My coding is working fine without 
SelectedValue='<%# DataBinder.Eval(Container.DataItem, "DataValue") %>'>

The error come out when i have this piece of code.

Help Please!!

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Mar 2011, 09:22 AM
Hello Johnson,

This is general error that means that the requested DataField(DataValue) doesn't exist in your data source of RadGrid(since you are using different DataSource for RadGrid and RadComboBox). Please make sure that your database contains field(DataValue). Hope this information helps.

-Shinu.
Tags
Grid
Asked by
johnson lim
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or