Question Can we break line space in between dynamic gridview

sriram0212

Member
Joined
Jun 20, 2020
Messages
8
Programming Experience
1-3
A gridview is placed in UI where the data retrieve from db it will dynamically create the rows according to the number of rows return from db can we able to break line space between the dynamic created rows
 
Is our OP talking about line wrapping a column value? Or do they really want a line breaks between rows? I ask because rows are already separated by breaks.
 
ASP.net:
<div class="OneColumn">
            <asp:Repeater runat="server" ID="RepView" OnItemDataBound= "RepView_ItemDataBound" OnItemCommand="RepView_ItemCommand">
              <HeaderTemplate>
                <table class="ViewPageTables" cellpadding="0" cellspacing="0" border="0">
                  <tr class="viewGridTitle">
                    <td class="viewGridTitle" width="30px">
                     ComponentName
                    </td>
                    <td class="viewGridTitle">
                     1
                    </td>
                    <td class="viewGridTitle">
                      2
                    </td>
                    <td class="viewGridTitle">
                      3
                    </td>     
<td class="viewGridTitle">
                      4
                    </td>
                  </tr>
              </HeaderTemplate>
              <ItemTemplate>
                <tr class="RowStyle">
                  <td> <%# DataBinder.Eval(Container.DataItem, "1")%>
                   </td>
                  <td>
                    <%# DataBinder.Eval(Container.DataItem, "2")%>
                  </td>
                    <td>
                    <%# DataBinder.Eval(Container.DataItem, "3")%>
                  </td>
                    <td>
                    <%# DataBinder.Eval(Container.DataItem, "4")%>
                  </td>
                    </tr>
              </ItemTemplate>             
              <AlternatingItemTemplate>
                <tr class="AlternatingRowStyle">
                   <td> <%# DataBinder.Eval(Container.DataItem, "1")%>
                   </td>
                  <td>
                    <%# DataBinder.Eval(Container.DataItem, "2")%>
                  </td>
                    <td>
                    <%# DataBinder.Eval(Container.DataItem, "3")%>
                  </td>
                    <td>
                    <%# DataBinder.Eval(Container.DataItem, "4")%>
                  </td>                             
                </tr>
              </AlternatingItemTemplate>
            </asp:Repeater>
          </div>

I need to break the dynamically creating rows one by one so I can add label in between each rows.
 
Last edited by a moderator:
This is not the GridView. This is the ASP.NET WebForms Repeater.

Moving to the appropriate subforum.

(Someone beat me to it...)
 
Anyway, you can put any legal HTML that will fit inside an HTML table because you chose to use a HTML table at the structure to be used by the Repeater. Remember that nothing in Repeater forces you to have only a single TR within the item template. So you could make two TRs. One for your separator, and one for your data. Alternatively, you could put a definition list in a row, and then style the term of the definition as the header and the definition as the data.
 

Latest posts

Back
Top Bottom