The DetailsView is pretty rigid in how it displays each record returned from the ObjectDataSource. If you want a more flexible view of the data see the FormView control that provides a higher level of customization.
Notes:
Algumas propriedades úteis:
<asp:DetailsView ID="NewProduct" runat="server" Height="50px" Width="125px"
AutoGenerateRows="False" DataSourceID="NewProductDataSource"
DefaultMode="Insert"AllowPaging="True">
<Fields>
<asp:BoundField DataField="ProductName" HeaderText="ProductName"
SortExpression="ProductName" />
<asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice"
SortExpression="UnitPrice" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>As propriedades AllowPaging e ShowInsertButton podem ser definidas através da smart tag do controlo. Já a propriedade DefaultMode pode ser definida no código/PropertiesPanel e permite as opções "Insert", "Edit" e "ReadOnly", definindo a forma como o controlo é exibido.
Referências:
No comments:
Post a Comment