
<asp:DetailsView ID="dtlv" runat="server" AutoGenerateRows="False"
BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
CellPadding="3" GridLines="Vertical" HorizontalAlign="Center"
AllowPaging="True" onpageindexchanging="dtlv_PageIndexChanging" DefaultMode="ReadOnly" AutoGenerateDeleteButton="False">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
<PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right"
VerticalAlign="Middle" />
<Fields>
<asp:BoundField DataField="CategoryId" HeaderText="C Id" />
<asp:BoundField DataField="Product_Name" HeaderText="Product Name" />
<asp:BoundField DataField="Product_price" HeaderText="Price" />
</Fields>
<HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
<EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<AlternatingRowStyle BackColor="#F7F7F7" />
<PagerSettings Mode="NumericFirstLast" FirstPageText="<<" LastPageText=">>"
PageButtonCount="1" />
</asp:DetailsView>
At Cs Page
public void bindPaging()
{
SqlDataAdapter da = new SqlDataAdapter("select CategoryId,Product_Name,Product_price from products", con);
DataSet ds = new DataSet();
da.Fill(ds);
dtlv.DataSource = ds;
dtlv.DataBind();
}
protected void dtlv_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
{
dtlv.PageIndex = e.NewPageIndex;
bindPaging();
}
call bindpaging at load..........
I think you can learn it now....
Himanshu Sharma
If you see Dreams then Get Success On Dreams.....
Gow.net, if this helps please login to Mark As Answer. | Alert Moderator