模态弹出GridView [英] modal popup gridview

查看:56
本文介绍了模态弹出GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个模式弹出窗口,其中包含一个datagrid视图,我在gridview中放置了一些复选框,以允许选择多个项目.
单击添加按钮"时,如何使数据网格中的所选项目出现在mainPage列表框中?

Hi
I have a modal popup containing a datagrid view in it, I have put some check boxes in the gridview to allow selection of multiple items.
How can I get the selected items in the datagrid to appear in the mainPage list box when I click Button Add?

<asp:Button ID="btnServices" runat="server" Text="Choose Services" />
               <asp:ModalPopupExtender ID="btnServices_ModalPopupExtender" runat="server"

                   DynamicServicePath="" OkControlID="btnAdd2" CancelControlID="btnCancel2" PopupControlID="PanelServices"

                   Enabled="True" TargetControlID="btnServices">
               </asp:ModalPopupExtender>
               <asp:Panel ID="PanelServices" runat="server">

               <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

                           DataKeyNames="serviceID" DataSourceID="SqlDataSource1" >
                           <Columns>
                               <asp:BoundField DataField="serviceID" HeaderText="serviceID" visible="false"

                                   InsertVisible="False" ReadOnly="True" SortExpression="serviceID" />
                               <asp:BoundField DataField="description" HeaderText="description"

                                   SortExpression="description" />
                               <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
                               <asp:BoundField DataField="Unit" HeaderText="Unit" SortExpression="Unit" />

                               <asp:TemplateField>
                                   <ItemTemplate>
                                       <asp:CheckBox ID="cbSelected" runat="server" />
                                       </ItemTemplate>
                               </asp:TemplateField>

                           </Columns>
                           <EditRowStyle BackColor="#2461BF" />
                           <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                           <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                           <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                           <RowStyle BackColor="#EFF3FB" />
                           <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                           <SortedAscendingCellStyle BackColor="#F5F7FB" />
                           <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                           <SortedDescendingCellStyle BackColor="#E9EBEF" />
                           <SortedDescendingHeaderStyle BackColor="#4870BE" />
                       </asp:GridView>
                       <asp:SqlDataSource ID="SqlDataSource1" runat="server"

                           ConnectionString="<%$ ConnectionStrings:Services %>"

                           SelectCommand="procReadServices" SelectCommandType="StoredProcedure">
                       </asp:SqlDataSource>
                       <br />
                       <asp:Button ID = "btnAdd2" runat = "server" Text = "Add"

                           onclick="btnAdd2_Click" />
                           <input type = "button" id = "btnCancel2" value = "Cancel" />

               </asp:Panel>



我想将所有选定的服务添加到此列表框中



I want to add all the selected sevices into this list box

<td>
                <asp:ListBox ID="lstServices" runat="server" Width="175px"></asp:ListBox>
            </td>




谢谢.....




Thanks.....

推荐答案

ConnectionStrings:服务%> " span> SelectCommand =" SelectCommandType =" < /asp:SqlDataSource > < br > < asp:Button ID =" runat =" 文本 =" span> onclick =" / > < 输入 =" id =" =" / > < /asp:Panel >
ConnectionStrings:Services %>" SelectCommand="procReadServices" SelectCommandType="StoredProcedure"> </asp:SqlDataSource> <br /> <asp:Button ID = "btnAdd2" runat = "server" Text = "Add" onclick="btnAdd2_Click" /> <input type = "button" id = "btnCancel2" value = "Cancel" /> </asp:Panel>



我想将所有选定的服务添加到此列表框中



I want to add all the selected sevices into this list box

<td>
                <asp:ListBox ID="lstServices" runat="server" Width="175px"></asp:ListBox>
            </td>




谢谢....




Thanks.....


这篇关于模态弹出GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆