簡體   English   中英

我只需要在gridview中合並一個特定的列

[英]I need to merge only a specific column in gridview

尊敬的觀眾我只需要一個特定的專欄不會一次又一次地在Gridview中重復我附上截圖你可以看到房間費用重復3次但是我需要重復這一次,然后它的費用和日期以簡單的語言顯示它是一個標題請審查

  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" Width="100%" BorderWidth="0px" BorderStyle="None" OnRowDataBound="GridView1_RowDataBound" ShowFooter="true" OnDataBound="GridView1_DataBound">
                      <Columns>

                         <asp:TemplateField HeaderStyle-BorderStyle="None" ItemStyle-BorderStyle="None" FooterStyle-BorderStyle="None" >

                             <ItemTemplate>

                                 <table style="width:100%;font-size:12px;text-align:left">
                                     <tr>
                                         <td colspan="5"> 
                                              <table style="width:100%;font-size:16px; font-weight:bold; font-family:Cambria, Cochin, Georgia, Times, Times New Roman, serif;text-align:left;margin-bottom:10px">
                                     <tr><td><u> <asp:Label ID="lblprintheading" runat="server" Text='<%#Eval("Headingname")%>' ></asp:Label></u>

                                         </td></tr>
                                 </table>
                                            </td>
                                     </tr>
                                     <tr>
                                         <td style="width:10%;">
                                             <asp:Label ID="lblservicedate" runat="server" Text='<%#Eval("Date")%>'></asp:Label>
                                         </td> <td style="width:50%;">
                 <asp:Label ID="lblparticular" runat="server" Text='<%#Eval("Servicename")%>'></asp:Label> &nbsp;(<asp:Label ID="Label22" runat="server" Text='<%#Eval("doctorname")%>'></asp:Label>)
              </td>
                <td style="width:10%;">
                   <asp:Label ID="lblrate" runat="server" Text='<%#Eval("Rate")%>'></asp:Label>
              </td>
                <td style="width:10%;">
                 <asp:Label ID="lblnos" runat="server" Text='<%#Eval("Qty")%>'></asp:Label>
              </td>
                 <td style="width:20%;">
                 <asp:Label ID="lblprice" runat="server" Text='<%#Eval("Nettotal")%>'></asp:Label>
              </td>
                                     </tr>


                                 </table>
                             </ItemTemplate>
                             <FooterTemplate >
                                  <table style="width:100%;text-align:center; border:0px none">
                                      <tr>
                                          <td colspan="5" style="text-align:right;padding-right:50px"> ..................................................................................</td>
                                      </tr>
                                      <tr>
                                           <td style="width:10%;">

                                         </td> <td style="width:50%;">

              </td>
                <td style="width:10%;">

              </td>
                                           <td style="width:10%; font-size:18px; font-weight:bold;">
                                                        Total:
                                                   </td>
                                          <td style="width:20%;">
                                              <asp:Label ID="Label18" runat="server" Text='<%#Eval("Nettotal")%>'></asp:Label>

                                          </td>
                                      </tr>
                                  </table>
                             </FooterTemplate>
                         </asp:TemplateField>

                      </Columns>
                  </asp:GridView>

https://i.stack.imgur.com/6Rl6K.png

您可以使用嵌套網格視圖。 哪個會給你你想要的完美結果。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM