ASPxGridView中的GridViewDataComboBoxColumn不绑定到EntityDataSource

时间:2015-12-21 15:26:08

标签: c# asp.net devexpress aspxgridview

我有ASPxGridView绑定到EntityDataSource。我的一个列需要引用另一个实体的列,因此我决定将其设为GridViewDataComboBoxColumn。我的.aspx代码如下:

<dx:ASPxGridView ID="gridDocumente" runat="server" DataSourceID="EDS" KeyFieldName="IDDocument" OnDataBinding="gridDocumente_DataBinding" AutoGenerateColumns="False" Theme="Moderno">
    <Settings ShowFilterRow="True" />
    <SettingsSearchPanel Visible="True" />
    <Columns>
        <dx:GridViewCommandColumn ShowDeleteButton="true" ShowUpdateButton="true" VisibleIndex="0" ShowClearFilterButton="True" ShowEditButton="True" ShowNewButtonInHeader="True"></dx:GridViewCommandColumn>
        <dx:GridViewDataColumn FieldName="IDDocument" VisibleIndex="1" Visible="false"><EditFormSettings Visible="False" /></dx:GridViewDataColumn>
        <dx:GridViewDataColumn FieldName="NrInregistrare" VisibleIndex="2"></dx:GridViewDataColumn>
        <dx:GridViewDataColumn FieldName="DataInregistrare" VisibleIndex="3"></dx:GridViewDataColumn>
        <dx:GridViewDataColumn FieldName="TipD" VisibleIndex="4"></dx:GridViewDataColumn>
        <dx:GridViewDataColumn FieldName="NumeDocument" VisibleIndex="5"></dx:GridViewDataColumn>
        <dx:GridViewDataColumn FieldName="Descriere" VisibleIndex="6"></dx:GridViewDataColumn>
        <dx:GridViewDataComboBoxColumn FieldName="TipDocument" VisibleIndex="7">
            <PropertiesComboBox DataSourceID="EDSTipDocument" ValueField="IDTipDocument"  TextField="NumeTipDocument" ValueType="System.Int32"></PropertiesComboBox>
        </dx:GridViewDataComboBoxColumn>
    </Columns>
</dx:ASPxGridView>
<ef:EntityDataSource ID="EDSTipDocument" runat="server" ContextTypeName="Users.Models.DocumentContext" EntitySetName="TipuriDocumente" OnContextCreating="EDS_ContextCreating"></ef:EntityDataSource>
<ef:EntityDataSource ID="EDS" runat="server" ContextTypeName="Users.Models.DocumentContext" EntitySetName="Documente" EnableDelete="true" EnableUpdate="true" OnContextCreating="EDS_ContextCreating"></ef:EntityDataSource>

虽然我试图按照互联网上的示例进行操作,GridViewDataComboBoxColumn不会绑定到EDSTipDocument数据源,但它在网格中没有显示任何内容。

你能帮我吗?

非常感谢!

0 个答案:

没有答案