Hi ramco1917,
Please refer below sample.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:Repeater ID="rptStudents" runat="server">
<HeaderTemplate>
<table class="table">
<tr>
<td>StudentId</td>
<td>StudentName</td>
<td>Status</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:Label ID="lblId" Text='<%#Eval("StudentId") %>' runat="server" /></td>
<td>
<asp:Label ID="lblName" Text='<%#Eval("StudentName") %>' runat="server" /></td>
<td>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-primary active rb1">
<asp:RadioButton ID="rb1" GroupName="options" runat="server" Checked="true" Text="P" />
</label>
<label class="btn btn-primary rb2">
<asp:RadioButton ID="rb2" GroupName="options" runat="server" Text="A" />
</label>
</div>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<style type="text/css">
body {
font-family: Arial;
font-size: 30pt;
}
.btn-primary {
border-radius: 100% !important;
color: #FFF !important;
}
.rb1.active {
background-color: green !important;
border-color: green !important;
}
.rb2.active {
background-color: red !important;
border-color: red !important;
}
</style>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
</form>
</body>
</html>
Namespaces
C#
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
VB.Net
Imports System.Data
Imports System.Configuration
Imports System.Data.SqlClient
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.BindRepeater();
}
}
private void BindRepeater()
{
string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
using (SqlConnection con = new SqlConnection(conString))
{
using (SqlCommand cmd = new SqlCommand("SELECT StudentId, StudentName, Status FROM Students", con))
{
using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
{
DataTable dt = new DataTable();
sda.Fill(dt);
rptStudents.DataSource = dt;
rptStudents.DataBind();
}
}
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Me.BindRepeater()
End If
End Sub
Private Sub BindRepeater()
Dim conString As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
Using con As SqlConnection = New SqlConnection(conString)
Using cmd As SqlCommand = New SqlCommand("SELECT StudentId, StudentName, Status FROM Students", con)
Using sda As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dt As DataTable = New DataTable()
sda.Fill(dt)
rptStudents.DataSource = dt
rptStudents.DataBind()
End Using
End Using
End Using
End Sub
Screentshot