Hi arie.keren,
Please refer below sample.
HTML
<asp:Repeater ID="rptCustomers" runat="server">
<HeaderTemplate>
<table cellspacing="0" rules="all" border="1">
<tr>
<th colspan="2">
Customers
</th>
<th colspan="2">
Employees
</th>
<tr>
<tr>
<th scope="col" style="width: 80px">
CustomerName
</th>
<th scope="col" style="width: 120px">
CustomerCountry
</th>
<th scope="col" style="width: 100px">
EmployeeName
</th>
<th scope="col" style="width: 100px">
EmployeeCountry
</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblCustomerId" runat="server" Text='<%# Eval("CustomerName") %>' />
</td>
<td>
<asp:Label ID="lblContactName" runat="server" Text='<%# Eval("CustomerCountry") %>' />
</td>
<td>
<asp:Label ID="lblCountry" runat="server" Text='<%# Eval("EmployeeName") %>' />
</td>
<td>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("EmployeeCountry") %>' />
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
Namespaces
C#
using System.Data;
VB.Net
Imports System.Data
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[4] { new DataColumn("CustomerName"), new DataColumn("CustomerCountry"), new DataColumn("EmployeeName"), new DataColumn("EmployeeCountry") });
dt.Rows.Add("John Hammond", "United States", "Albert Dunner", "Bolivia");
dt.Rows.Add("Mudassar Khan", "India", "Jason Sprint", "Canada");
dt.Rows.Add("Suzanne Mathews", "France", "Alfred Lobo", "Philippines");
dt.Rows.Add("Robert Schidner", "Russia", "Shaikh Ayyaz", "UAE");
rptCustomers.DataSource = dt;
rptCustomers.DataBind();
}
}
VB.Net
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim dt As New DataTable()
dt.Columns.AddRange(New DataColumn(3) {New DataColumn("CustomerName"), New DataColumn("CustomerCountry"), New DataColumn("EmployeeName"), New DataColumn("EmployeeCountry")})
dt.Rows.Add("John Hammond", "United States", "Albert Dunner", "Bolivia")
dt.Rows.Add("Mudassar Khan", "India", "Jason Sprint", "Canada")
dt.Rows.Add("Suzanne Mathews", "France", "Alfred Lobo", "Philippines")
dt.Rows.Add("Robert Schidner", "Russia", "Shaikh Ayyaz", "UAE")
rptCustomers.DataSource = dt
rptCustomers.DataBind()
End If
End Sub
Screenshot
