布局如下图:
单击“新增地区价格”按钮会操控同级的那个浅绿色的gridview(在DetailsView)里。
<Templates> <DetailRow> <div style="overflow:hidden;line-height:23px;margin-bottom:5px;"> <span style="float:left;"><%# Eval("Name") %>地区价格表:</span> <dx:ASPxButton ID="btnExpressAreaAdd" runat="server" Text="新增地区价格" OnClick="btnExpressAreaAdd_Click" style="float:right;"> <Paddings Padding="0" /> </dx:ASPxButton> </div> <dx:ASPxGridView ID="agvExpressArea" runat="server" SkinID="agvDetailSkin" Width="100%" OnBeforePerformDataSelect="agvExpressArea_BeforePerformDataSelect"> <Columns> <dx:GridViewDataTextColumn Caption="运达地区" FieldName="Area" VisibleIndex="0"></dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="首重价格(元)" FieldName="FirstCost" VisibleIndex="1"></dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="续重价格(元)" FieldName="NextCost" VisibleIndex="2"> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="类型" FieldName="ItemType" VisibleIndex="3"> </dx:GridViewDataTextColumn> <dx:GridViewCommandColumn Caption="操作" HeaderStyle-HorizontalAlign="Center" Width="60" VisibleIndex="4"> <DeleteButton Text="删除" Visible="true" /> </dx:GridViewCommandColumn> </Columns> </dx:ASPxGridView> </DetailRow> </Templates>