Hi Mehram,
You need to call OnItemDataBound event and inside that you need to hide the header of the rows from 2nd onwords.
Refer below sample.
HTML
<asp:DataList ID="dlFabric" runat="server" RepeatLayout="Table" RepeatColumns="2" RepeatDirection="Horizontal" OnItemDataBound="OnItemDataBound">
<ItemTemplate>
<table>
<tr id="trHeader" runat="server">
<th style="width: 100px;">Artical #
</th>
<th style="width: 100px;">Stock Qty
</th>
</tr>
<tr>
<td style="width: 100px;">
<asp:Label ID="lblTotalCount" runat="server" Text='<%#Eval("articalno") %>'></asp:Label>
</td>
<td style="width: 100px;">
<asp:Label ID="lblActiveMembersCount" runat="server" Text='<%#Eval("BalanceQty") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
Namespace
C#
using System.Data;
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] {
new DataColumn("articalno"),
new DataColumn("BalanceQty") });
dt.Rows.Add("1441", "1234");
dt.Rows.Add("1567", "1896");
dt.Rows.Add("1571", "1347");
dt.Rows.Add("1231", "1977");
dlFabric.DataSource = dt;
dlFabric.DataBind();
}
}
protected void OnItemDataBound(object sender, DataListItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
if (e.Item.ItemIndex >= dlFabric.RepeatColumns)
{
HtmlTableRow headerRow = (HtmlTableRow)e.Item.FindControl("trHeader");
headerRow.Visible = false;
}
}
}
Screenshot