i have error massage
'DevExpress.Web.Data.WebDataRow' does not contain a property with the name 'Item_Code' when i selected value from ASPxComboBox in ASPxGridView using EditItemTemplate
C#protected void Page_Load(object sender, EventArgs e)
{
GV_TransDet.DataSource = Session["Detail"];
GV_TransDet.DataBind();
}
protected void btnShow_Click(object sender, EventArgs e)
{
Session["Detail"] = null;
Table = new DataTable();
Table.Columns.Add("Trans_Det", typeof(Int32));
Table.Columns.Add("Trans_ID", typeof(Int32));
Table.Columns.Add("Item_Code", typeof(Int32));
Table.Columns.Add("Trans_ItemPrice", typeof(double));
Table.Columns.Add("Trans_Qty", typeof(Int32));
Table.Columns.Add("Trans_TotalPrice", typeof(double));
Table.Columns.Add("Trans_Comment", typeof(string));
Table.PrimaryKey = new DataColumn[] { Table.Columns["Trans_Det"] };
Table.Columns["Trans_Det"].AutoIncrement = true;
Table = new DataAccess().ToTable(@"SELECT [Trans_Det] ,Det.[Trans_ID] ,[Item_Code] ,[Trans_ItemPrice] ,[Trans_Qty] ,[Trans_TotalPrice] ,Det.[Trans_Comment]
FROM ST_TransMaster MS
left join ST_TransDetails Det on MS.Trans_ID = Det.Trans_ID
WHERE MS.Stock_Code = '" + StockCode + "' AND MS.Trans_Code = '" + TransCode + "' AND MS.Doc_No = '" + DocNO + "'");
Session["Detail"] = Table;
GV_TransDet.DataSource = Session["Detail"];
GV_TransDet.DataBind();
}
ASPx <dx:ASPxGridView ID="GV_TransDet" ClientInstanceName="grid"
runat="server" KeyFieldName="Trans_Det" EnableRowsCache="False" Width="100%" Theme="MaterialCompact"
OnCustomJSProperties="GV_TransDet_CustomJSProperties" AutoGenerateColumns="False" OnCustomCallback="GV_TransDet_CustomCallback">
<ClientSideEvents Init="function(s,e){grid.AddNewRow();AddKeyboardNavigationTo(s);}" RowClick="function(s, e) {s.StartEditRow(e.visibleIndex);}" /><%-- BatchEditStartEditing="onBatchEditStartEditing" BatchEditEndEditing="OnBatchEditEndEditing"--%>
<Columns>
<dx:GridViewDataComboBoxColumn FieldName="Item_Code" Width="25%" Caption="اسم الصنف">
<PropertiesComboBox DataSourceID="ODSItems" ValueType="System.String" ValueField="Item_Code" TextField="Item_ArName">
<ClientSideEvents SelectedIndexChanged="OnSelectedIndexChanged" />
<ValidationSettings RequiredField-IsRequired="true" Display="Dynamic" />
</PropertiesComboBox>
<EditItemTemplate>
<dx:ASPxComboBox ID="txtcodestock" runat="server" Width="100%" DropDownWidth="550" AutoPostBack="true" OnSelectedIndexChanged="txtcodestock_SelectedIndexChanged"
DropDownStyle="DropDownList" DataSourceID="ODSItems" ValueField="Item_Code" Value='<%# Bind("Item_Code") %>'
ValueType="System.String" TextFormatString="{0} ({1})" EnableCallbackMode="true" IncrementalFilteringMode="Contains" Theme="MaterialCompact"
CallbackPageSize="30">
<Columns>
<dx:ListBoxColumn Caption="اسم المخزن" FieldName="Item_ArName" />
<dx:ListBoxColumn Caption="الكود" Width="40px" FieldName="Item_Code" />
</Columns>
</dx:ASPxComboBox>
</EditItemTemplate>
</dx:GridViewDataComboBoxColumn>
</Columns>
<SettingsEditing Mode="Inline" NewItemRowPosition="Bottom" />
<SettingsCommandButton>
<DeleteButton RenderMode="Image">
<Image ToolTip="Delete" Url="../img/Icons/delete.png" />
</DeleteButton>
<NewButton RenderMode="Image">
<Image ToolTip="New" Url="../img/Icons/New.png" />
</NewButton>
<CancelButton RenderMode="Image">
<Image ToolTip="Cancel" Url="../img/Icons/Cancel.png" />
</CancelButton>
<UpdateButton RenderMode="Image">
<Image ToolTip="Update" Url="../img/Icons/Update.png" />
</UpdateButton>
</SettingsCommandButton>
<%--<SettingsEditing Mode="Batch" BatchEditSettings-EditMode="Row" BatchEditSettings-StartEditAction="Click" BatchEditSettings-ShowConfirmOnLosingChanges="false" />--%>
<SettingsPager PageSize="30" EnableAdaptivity="false" />
<Styles Header-Wrap="True">
<Header Wrap="True"></Header>
</Styles>
</dx:ASPxGridView>
<asp:ObjectDataSource ID="ODSItems" runat="server" SelectMethod="Items" TypeName="MaviqStock">
<SelectParameters>
<asp:SessionParameter Name="UserCode" SessionField="UserCode" Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>