Hi Rahul123,
I have made one sample that full-fill your requirement.
HTML
<asp:DataList ID="dlCustomers" runat="server" RepeatColumns="2" CellPadding="5">
<ItemTemplate>
<table class="table" border="0" cellpadding="0" cellspacing="0">
<tr>
<th colspan="3" align="left">
<asp:CheckBox ID="chkRow" runat="server" Font-Bold="true" Text='<%# Eval("Name")%>'
AutoPostBack="true" OnCheckedChanged="CheckedChanged" />
</th>
</tr>
<tr>
<td>
Customer Id
</td>
<td>
<asp:Label Text='<%#Eval("Id")%>' runat="server" ID="lblId" />
</td>
</tr>
<tr>
<td>
Country
</td>
<td>
<asp:Label Text='<%#Eval("Country")%>' runat="server" ID="lblCountry" />
</td>
</tr>
</table>
<br />
<asp:Label runat="server" ID="lblMsg" ForeColor="Red" />
</ItemTemplate>
</asp:DataList>
Code
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[3] { new DataColumn("Id"), new DataColumn("Name"), new DataColumn("Country") });
dt.Rows.Add(1, "John Hammond", "United States");
dt.Rows.Add(2, "Mudassar Khan", "India");
dt.Rows.Add(3, "Suzanne Mathews", "France");
dt.Rows.Add(4, "Robert Schidner", "Russia");
dlCustomers.DataSource = dt;
dlCustomers.DataBind();
}
}
protected void CheckedChanged(object sender, EventArgs e)
{
foreach (DataListItem item in dlCustomers.Items)
{
CheckBox chk = (CheckBox)item.FindControl("chkRow");
Label id = (Label)item.FindControl("lblId");
Label country = (Label)item.FindControl("lblCountry");
Label message = (Label)item.FindControl("lblMsg");
if (chk.Checked == true)
{
message.Text = "Id = " + id.Text + "<br/>" + "Country = " + country.Text;
}
else if (chk.Checked == false)
{
message.Text = string.Empty;
}
}
}
Screenshot