
HeaderStyle -Style used for header row RowStyle -Style used to display rows CommandRowStyle -Style used to display row that contains edit buttons FooterStyle -Style used for footer row PagerStyle -Style used to control the pager row appearance EmptyDataRowStyle-Style used to display row when data source does not return data items EditRowStyle -Style used to display rows when the DetailsView is in Edit
<asp:DetailsView ID="DetailsView1" runat="Server"
ForeColor="#333333"
Width="60%" DataSourceID="MyDataSource"
AllowPaging="True" AutoGenerateRows="False"
DataKeyNames="Code" AutoGenerateDeleteButton="True"
AutoGenerateEditButton="True" AutoGenerateInsertButton="True" >
<FooterStyle Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="Beige" Font-Bold="True" />
<EditRowStyle BackColor="BlueViolet" />
<RowStyle BackColor="Chocolate" ForeColor="Black" />
<PagerStyle BackColor="Gold" ForeColor="White" HorizontalAlign="Center" />
<FieldHeaderStyle BackColor="Aquamarine" Font-Bold="True" />
<HeaderStyle BackColor="AliceBlue" Font-Bold="True" />
<AlternatingRowStyle BackColor="White" ForeColor="DarkGray" />
<InsertRowStyle BackColor="DeepSkyBlue" Font-Bold="True" ForeColor="DeepPink" />
<Fields>
<asp:BoundField DataField="Code" HeaderText="Code" />
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Description" HeaderText="Description" />
</Fields>
</asp:DetailsView>
<asp:SqlDataSource ID="MyDataSource" ConnectionString="<%$Connectionstrings:ERPConnectionString%>"
SelectCommand="SELECT * FROM Sample"
InsertCommand="Insert SAMPLE(Code,Name,Description) VALUES(@Code,@Name,@Description)"
runat="server"/>
Copyright © 2012 - All Rights Reserved - VKInfotek.com