DetailsView Cannot be look like what you are thinking Use ListView or GridVirew Instead. Here i have shown you how to apply the curves to table.
HTML:
<div class="rounded_corners" style="width: 300px">
<asp:DetailsView ID="DetailsView1" CssClass="table table-curved" AllowPaging="True"
HeaderStyle-BackColor="#3AC0F2" HeaderStyle-ForeColor="White" RowStyle-BackColor="#A1DCF2"
AlternatingRowStyle-BackColor="White" RowStyle-ForeColor="#3A3A3A" Width="300"
OnPageIndexChanging="DetailsView1_OnPageIndexChanging" runat="server">
<Fields>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Company" HeaderText="Company" />
<asp:BoundField DataField="Qual" HeaderText="Qual" />
<asp:BoundField DataField="PersNo" HeaderText="PersNo" />
</Fields>
</asp:DetailsView>
</div>
STYLE:
<style type="text/css">
.rounded_corners
{
border: 1px solid #A1DCF2;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
overflow: hidden;
}
.rounded_corners td, .rounded_corners th
{
border: 1px solid #A1DCF2;
font-family: Arial;
font-size: 10pt;
text-align: center;
}
.rounded_corners table table td
{
border-style: none;
}
</style>
C#:
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.PopulateGrid();
}
}
private void PopulateGrid()
{
string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
string sqlStatment = "SELECT * FROM pers";
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlCommand cmd = new SqlCommand(sqlStatment, con))
{
using (SqlDataAdapter da = new SqlDataAdapter(cmd))
{
DataSet ds = new DataSet();
da.Fill(ds);
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
this.DetailsView1.DataSource = ds;
this.DetailsView1.DataBind();
}
}
}
}
protected void DetailsView1_OnPageIndexChanging(object sender, DetailsViewPageEventArgs e)
{
this.DetailsView1.PageIndex = e.NewPageIndex;
PopulateGrid();
}
OUTPUT:
