title: Need to add a horizontal line to divide the rows in asp gridview
body: <p>I have a requirement where I  need to create dynamic rows with controls and for that I have used gridview. The issue is I am unable to display a black horizontal line between rows.</p>
  
  <p>Requirement:
  <a href="https://i.stack.imgur.com/Y5Nyo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y5Nyo.jpg" alt="enter image description here"></a></p>
  
  <p>My design:
  <a href="https://i.stack.imgur.com/b7bfp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b7bfp.jpg" alt="enter image description here"></a></p>
  
  <p>css:</p>
  
  <pre><code>.alternateStyler {
  margin-top:2px;  // just wanted to see if it works, did not work though.    
  }
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>&lt;asp:GridView ID="gvDelayIssueRisk" Width="98%" CssClass="labels" runat="server" ShowFooter="true" AutoGenerateColumns="false"
     Style="margin-left: auto; margin-right: auto;"
     OnSelectedIndexChanging="gvDelayIssueRisk_SelectedIndexChanging"
     OnRowDataBound="gvDelayIssueRisk_RowDataBound"
     AlternatingRowStyle-CssClass="alternateStyler"&gt;
     &lt;Columns&gt;
        &lt;%--   &lt;asp:BoundField DataField="noteid" HeaderText="ID" /&gt;--%&gt;
        &lt;asp:TemplateField HeaderText="Type" ItemStyle-Width="10%" ItemStyle-VerticalAlign="Top" FooterStyle-VerticalAlign ="Top"&gt;
           &lt;ItemTemplate&gt;
              &lt;asp:Label ID="lblType" runat="server" Text='&lt;%# Eval("Author") %&gt;' Visible="false" /&gt;
              &lt;asp:DropDownList ID="ddlType" Width="98%" runat="server" CssClass="DropDownListStyle"&gt;&lt;/asp:DropDownList&gt;
           &lt;/ItemTemplate&gt;
           &lt;FooterTemplate&gt;
              &lt;asp:DropDownList ID="ddlType2" Width="98%" runat="server" CssClass="DropDownListStyle"&gt;&lt;/asp:DropDownList&gt;
           &lt;/FooterTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Impact" ItemStyle-Width="10%" ItemStyle-VerticalAlign="Top" FooterStyle-VerticalAlign ="Top"&gt;
           &lt;ItemTemplate&gt;
              &lt;asp:Label ID="lblImpact" runat="server" Text='&lt;%# Eval("Author") %&gt;' Visible="false" /&gt;
              &lt;asp:DropDownList ID="ddlImpact" Width="98%" runat="server" CssClass="DropDownListStyle"&gt;&lt;/asp:DropDownList&gt;
           &lt;/ItemTemplate&gt;
           &lt;FooterTemplate&gt;
              &lt;asp:DropDownList ID="ddlImpact2" Width="98%" runat="server" CssClass="DropDownListStyle"&gt;&lt;/asp:DropDownList&gt;
           &lt;/FooterTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="DIR Description" ItemStyle-Width="20%" ItemStyle-VerticalAlign="Top" FooterStyle-VerticalAlign ="Top"&gt;
           &lt;ItemTemplate&gt;
              &lt;asp:TextBox ID="txtDIRDesc" Width="98%" TextMode="MultiLine" Height="100px" runat="server" Text='&lt;%# Eval("notes")%&gt;'&gt;&lt;/asp:TextBox&gt;
           &lt;/ItemTemplate&gt;
           &lt;FooterTemplate&gt;
              &lt;asp:TextBox ID="txtDIRDesc2" Width="98%" TextMode="MultiLine" Height="100px" runat="server"&gt;&lt;/asp:TextBox&gt;
           &lt;/FooterTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Remediation Plan" ItemStyle-Width="20%" ItemStyle-VerticalAlign="Top" FooterStyle-VerticalAlign ="Top"&gt;
           &lt;ItemTemplate&gt;
              &lt;asp:TextBox ID="txtRemPlan" Width="98%" TextMode="MultiLine" Height="100px" runat="server" Text='&lt;%# Eval("notes")%&gt;'&gt;&lt;/asp:TextBox&gt;
           &lt;/ItemTemplate&gt;
           &lt;FooterTemplate&gt;
              &lt;asp:TextBox ID="txtRemPlan2" Width="98%" TextMode="MultiLine" Height="100px" runat="server"&gt;&lt;/asp:TextBox&gt;
           &lt;/FooterTemplate&gt;
        &lt;/asp:TemplateField&gt;
                                              &lt;asp:TemplateField HeaderText="Owner" ItemStyle-Width="10%" ItemStyle-VerticalAlign="Top" FooterStyle-VerticalAlign ="Top"&gt;
                                                  &lt;ItemTemplate&gt;
                                                      &lt;asp:TextBox ID="txtOwner" Width="98%" runat="server" Text='&lt;%# Eval("notes")%&gt;'&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/ItemTemplate&gt;
                                                  &lt;FooterTemplate&gt;
                                                      &lt;asp:TextBox ID="txtOwner2" Width="98%" runat="server"&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/FooterTemplate&gt;
                                              &lt;/asp:TemplateField&gt;
                                              &lt;asp:TemplateField HeaderText="Due Date" ItemStyle-Width="8%" ItemStyle-VerticalAlign="Top" FooterStyle-VerticalAlign ="Top"&gt;
                                                  &lt;ItemTemplate&gt;
                                                      &lt;asp:TextBox ID="dtDueDate" CssClass="Datetext" Width="98%" runat="server" Text='&lt;%# Eval("DateAdded")%&gt;'&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/ItemTemplate&gt;
                                                  &lt;FooterTemplate&gt;
                                                      &lt;asp:TextBox ID="dtDueDate2" CssClass="Datetext" Width="98%" runat="server"&gt;
                                                      &lt;/asp:TextBox&gt;
                                                  &lt;/FooterTemplate&gt;
                                              &lt;/asp:TemplateField&gt;
                                               &lt;asp:TemplateField HeaderText="Complete Date" ItemStyle-Width="8%" ItemStyle-VerticalAlign="Top" FooterStyle-VerticalAlign ="Top"&gt;
                                                  &lt;ItemTemplate&gt;
                                                      &lt;asp:TextBox ID="dtCompleteDate" CssClass="Datetext" Width="98%" runat="server" Text='&lt;%# Eval("DateAdded")%&gt;'&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/ItemTemplate&gt;
                                                  &lt;FooterTemplate&gt;
                                                      &lt;asp:TextBox ID="dtCompleteDate2" CssClass="Datetext" Width="98%" runat="server"&gt;
                                                      &lt;/asp:TextBox&gt;
                                                  &lt;/FooterTemplate&gt;
                                              &lt;/asp:TemplateField&gt; 
                                              &lt;asp:TemplateField HeaderText="Notes" ItemStyle-Width="20%" ItemStyle-VerticalAlign="Top" FooterStyle-VerticalAlign ="Top"&gt;
                                                  &lt;ItemTemplate&gt;
                                                      &lt;asp:TextBox ID="txtDelayNotes" Width="98%" TextMode="MultiLine" Height="100px" runat="server" Text='&lt;%# Eval("notes")%&gt;'&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/ItemTemplate&gt;
                                                  &lt;FooterTemplate&gt;
                                                      &lt;asp:TextBox ID="txtDelayNotes2" Width="98%" TextMode="MultiLine" Height="100px" runat="server"&gt;&lt;/asp:TextBox&gt;
                                                  &lt;/FooterTemplate&gt;
                                              &lt;/asp:TemplateField&gt;
                                          &lt;/Columns&gt;
                                      &lt;/asp:GridView&gt;
  </code></pre>