UserControl(ascx)的Ajax Control Toolkit TabContainer问题

时间:2011-07-15 10:09:12

标签: asp.net devexpress ajaxcontroltoolkit aspxgridview

我正在使用DevExpress ASPxGridView来显示,插入,编辑数据。要插入和编辑我正在使用Templates-> EditForm并对列进行分组我正在使用来自Ajax Control Toolkit的TabContainer,并且在一个选项卡中我想使用UserControl(ascx)来管理属性。 遗憾的是渲染它有一些问题,因为它不适合TabPanel并且它从面板中突出。

<dx:ASPxGridView ID="ASPxGridView_Contractors" runat="server" Width="100%" 
AutoGenerateColumns="False" ClientIDMode="AutoID" 
DataSourceID="ObjectDataSource_Contractors" KeyFieldName="ContractorId" 
EnableCallBacks="False" ondetailrowexpandedchanged="ASPxGridView_Contractors_DetailRowExpandedChanged"
>
<Columns>
    /* some columns */
</Columns>
<SettingsBehavior AllowFocusedRow="True" />
<Settings ShowFilterRow="True" ShowGroupPanel="True" />
<SettingsDetail ShowDetailRow="True" />
<Templates>
    <DetailRow>
        /* detail row */
    </DetailRow>
    <EditForm> 
        <div style="padding: 3px 3px 2px 3px">

            <asp:TabContainer ID="TabContainer_ContractorDetailsEdit" runat="server" AutoPostBack="true">

                <asp:TabPanel ID="TabPanel_GeneralEdit" runat="server" HeaderText="<%$Resources:Tags, General %>" >
                    <ContentTemplate>
                        /* General */
                    </ContentTemplate>
                </asp:TabPanel> 

                <asp:TabPanel ID="TabPanel_AddressEdit" runat="server" HeaderText="<%$Resources:Tags, Address %>" >
                    <ContentTemplate>
                        /* Address */                            
                    </ContentTemplate>
                </asp:TabPanel>  

                <asp:TabPanel ID="TabPanel_ContractorDescriptionEdit" runat="server" HeaderText="<%$Resources:Tags, Description %>">
                    <ContentTemplate>
                        <dx:ASPxMemo runat="server" ID="ASPxMemo_DescriptionEdit" Text='<%# Eval("Description")%>' 
                            Width="100%" Height="93px">
                        </dx:ASPxMemo>
                    </ContentTemplate>
                </asp:TabPanel>

                <asp:TabPanel ID="TabPanel_ContactDataEdit" runat="server" HeaderText="<%$Resources:Tags, ContactData %>" >
                    <ContentTemplate>
                        /* ContactData */  
                    </ContentTemplate>
                </asp:TabPanel>  

                <asp:TabPanel ID="TabPanel_AttributesEdit" runat="server" HeaderText="<%$Resources:Tags, Attributes %>" >
                    <ContentTemplate>
                        /* problem */
                        <uc:Attributes ID="ContractorAttributes_Edit" runat="server" Editable="true" Source="Contractor"/> <-- problem
                    </ContentTemplate>
                </asp:TabPanel>

                <asp:TabPanel ID="TabPanel_SystemsEdit" runat="server" HeaderText="<%$Resources:Tags, Systems %>" >
                    <ContentTemplate>
                    </ContentTemplate>
                </asp:TabPanel>
            </asp:TabContainer>
            <dx:ASPxGridViewTemplateReplacement runat="server" ID="tr_UpdateButton" 
                ReplacementType="EditFormUpdateButton">
            </dx:ASPxGridViewTemplateReplacement>

            <dx:ASPxGridViewTemplateReplacement runat="server" ID="tr_CancelButton" 
                ReplacementType="EditFormCancelButton">
            </dx:ASPxGridViewTemplateReplacement>
        </div>
    </EditForm>
</Templates>

我做错了吗?

1 个答案:

答案 0 :(得分:0)

这实际上不是解决这个特定问题的方法。但是,它应该允许您继续开发,因此我在此处发布。我建议您使用ASPxPerience Suite中的ASPxPageControl,一切都会正常工作。