如何使用Datagrid中的编辑按钮显示模式

时间:2019-03-11 14:46:04

标签: c# asp.net

嗨,我目前正在尝试找到一种方法,无论何时我单击表上的“编辑”按钮都可以显示模态。这是我的前端代码:

<div class="col-sm-3"></div>
    <div class=" row col-sm-6 panel-body">          
        <asp:DataGrid CssClass=" table table-borderless" OnItemCommand="PO_Form_ItemCommand" ID="PO_Form" runat="server" AutoGenerateColumns="false">
            <Columns>
               <asp:ButtonColumn ButtonType="LinkButton" Text="Edit" CommandName="grdEdit"></asp:ButtonColumn>                    
               <asp:ButtonColumn ButtonType="LinkButton" Text="Delete" CommandName="grdDel"></asp:ButtonColumn>
             <asp:BoundColumn DataField="PO_no" HeaderText="PO No." />
             <asp:BoundColumn DataField="supplier_name" HeaderText="Supplier name" />
             <asp:BoundColumn DataField="flight_no" HeaderText="Flight No." />
             <asp:BoundColumn DataField="bkg_date" HeaderText="Booking Date" />
             <asp:BoundColumn DataField="status" HeaderText="Status" />
         </Columns>
            <HeaderStyle BackColor="#666666" />
        </asp:DataGrid>
    </div>

   <%-- Modal top --%> 
    <div id="editmodal" class="modal" runat="server" role="dialog">
        <div class="modal-dialog">

            <%-- Modal Content --%>

            <div class="modal-content">
                <div class="modal-content">
                    <button type="button" class="btn btn-default" data-dismiss="modal">&times;</button>
                </div>

                <div class="modal-body">

                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"></button>
                </div>

            </div>

        </div>

    </div>

   <%-- Modal Bottom --%>

如果有人了解我的情况,那将真的很有帮助。谢谢。

0 个答案:

没有答案