一个GridView 模版列 拆分行实例

本文通过实例演示了如何在GridView中将模板列的内容进行拆分,展示为多行效果,详细步骤包括设置样式、调整布局等,帮助开发者实现更灵活的数据展示。
摘要由CSDN通过智能技术生成


效果图




<asp:GridView ID="GridView" runat="server" AutoGenerateColumns="False"  DataKeyNames="RECORD_ID,SEQ"
					                        BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" 
					                         EmptyDataText="No data." Font-Size="9pt" HorizontalAlign="Left"
                                            Style="left: 34px; top: 240px" Width="98%" 
                            onrowdatabound="GridView_RowDataBound" 
                            onrowdeleting="GridView_RowDeleting" >
                        <EmptyDataRowStyle BackColor="LightYellow" BorderColor="Black" BorderStyle="Solid"
                            BorderWidth="1px" ForeColor="Black" />
                        <RowStyle BackColor="LightYellow" ForeColor="Gray" />
                      
                        <AlternatingRowStyle BackColor="White" ForeColor="DimGray" />
                         <Columns>
                            <asp:TemplateField ShowHeader="False">  
                                    <ItemTemplate>  
                                        <asp:LinkButton ID="lnkDel" runat="server" CausesValidation="False" CommandName="Delete"  
                                            Text="删除" OnClientClick='<%#  "if (!confirm(\"你确定要删除吗?\")) return false;"%>'></asp:LinkButton>  
                                    </ItemTemplate>  
                                    <ItemStyle Width="40px" />
                            </asp:TemplateField>  
                            
                            <asp:BoundField DataField="RECORD_ID"  Visible="False">
                            </asp:BoundField>
                            
                            <asp:BoundField DataField="SEQ" HeaderText="序号">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="30px" />
                            </asp:BoundField>
                            

                            
                            <asp:BoundField DataField="ZHONGXIN" HeaderText="中心">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="70px" />
                                <HeaderStyle Width="70px" />
                            </asp:BoundField>
                            
                            <asp:BoundField DataField="BUMEN" HeaderText="部门">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="70px" />
                                <HeaderStyle Width="70px" />
                            </asp:BoundField>       
                            
                            <asp:BoundField DataField="XINGMING" HeaderText="姓名">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="70px" />
                                <HeaderStyle Width="70px" />                                
                            </asp:BoundField>        

                            <asp:BoundField DataField="GONGHAO" HeaderText="工号">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="70px" />
                                <HeaderStyle Width="70px" />                                
                            </asp:BoundField>       
                                                                                                   
                            <asp:BoundField DataField="GANGWEI" HeaderText="岗位">
                                <HeaderStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" />
                                <ItemStyle Width="90px" />
                                <HeaderStyle Width="90px" />                                
                            </asp:BoundField> 
                            
                             <asp:TemplateField HeaderText="">
                                <HeaderStyle Wrap="False"  VerticalAlign="Middle" />
                                <ItemStyle Width="60px" />
                                 <ItemTemplate>
                                     <table>
                                         <tr>
                                             <td style="bor
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值