datagrid怎么设置分页?
发表于:2007-06-30来源:作者:点击数:
标签:
lt;asp:DataGrid id=quot;programmaticIDquot; runat=serverbr nbsp;nbsp;nbsp;nbsp;nbsp;DataSource=@#lt;%# DataBindingExpression %gt;@#br nbsp;nbsp;nbsp;nbsp;nbsp;AllowPaging=quot;True|Falsequot;br nbsp;nbsp;nbsp;nbsp;nbsp;AllowSorting=quot;Tru
<asp:DataGrid id="programmaticID" runat=server<br>
DataSource=@#<%# DataBindingExpression %>@#<br>
AllowPaging="True|False"<br>
AllowSorting="True|False"<br>
AutoGenerateColumns="True|False"<br>
BackImageUrl="url"<br>
CellPadding="pixels"<br>
CellSpacing="pixels"<br>
DataKeyField="DataSourceKeyField"<br>
GridLines="None|Horizontal|Vertical|Both"<br>
HorizontalAlign="Center|Justify|Left|NotSet|Right"<br>
PagedDataSource<br>
PageSize="ItemCount"<br>
ShowFooter="True|False"<br>
ShowHeader="True|False"<br>
VirtualItemCount="ItemCount"<br>
OnCancelCommand="OnCancelCommandMethod"<br>
OnDeleteCommand="OnDeleteCommandMethod"<br>
OnEditCommand="OnEditCommandMethod"<br>
OnItemCommand="OnItemCommandMethod"<br>
OnItemCreated="OnItemCreatedMethod"<br>
OnPageIndexChanged="OnPageIndexChangedMethod"<br>
OnSortCommand="OnSortCommandMethod"<br>
OnUpdateCommand="OnUpdateCommandMethod"><br>
<br>
<AlternatingItemStyle property="value"/><br>
<EditItemStyle property="value"/><br>
<FooterStyle property="value"/><br>
<HeaderStyle property="value"/><br>
<ItemStyle property="value"/><br>
<PagerStyle property="value"/><br>
<SelectedItemStyle property="value"/><br>
<br>
</asp:DataGrid><br>
or<br>
<asp:DataGrid id="programmaticID" runat=server<br>
DataSource=@#<%# DataBindingExpression %>@#<br>
AutoGenerateColumns="False"<br>
(other properties)><br>
<br>
<AlternatingItemStyle property="value"/><br>
<EditItemStyle property="value"/><br>
<FooterStyle property="value"/><br>
<HeaderStyle property="value"/><br>
<ItemStyle property="value"/><br>
<PagerStyle property="value"/><br>
<SelectedItemStyle property="value"/><br>
<br>
<Columns><br>
<asp:BoundColumn<br>
DataField="DataSourceField"<br>
DataFormatString="FormatString"<br>
FooterText="FooterText"<br>
HeaderImageUrl="url"<br>
HeaderText="HeaderText"<br>
ReadOnly="True|False"<br>
SortField="DataSourceFieldToSortBy"<br>
Visible="True|False"<br>
FooterStyle-property="value"<br>
HeaderStyle-property="value"<br>
ItemStyle-property="value"/><br>
<br>
<asp:ButtonColumn<br>
ButtonType="LinkButton|PushButton"<br>
Command="BubbleText"<br>
DataTextField="DataSourceField"<br>
DataTextFormatString="FormatString"<br>
FooterText="FooterText"<br>
HeaderImageUrl="url"<br>
HeaderText="HeaderText"<br>
ReadOnly="True|False"<br>
SortField="DataSourceFieldToSortBy"<br>
Text="ButtonCaption"<br>
Visible="True|False"/><br>
<br>
<asp:EditCommandColumn<br>
ButtonType="LinkButton|PushButton"<br>
CancelText="CancelButtonCaption"<br>
EditText="EditButtonCaption"<br>
FooterText="FooterText"<br>
HeaderImageUrl="url"<br>
HeaderText="HeaderText"<br>
ReadOnly="True|False"<br>
SortField="DataSourceFieldToSortBy"<br>
UpdateText="UpdateButtonCaption"<br>
Visible="True|False"/><br>
<br>
<asp:HyperLinkColumn<br>
DataNavigateUrlField="DataSourceField"<br>
DataNavigateUrlFormatString="FormatExpression"<br>
DataTextField="DataSourceField"<br>
DataTextFormatString="FormatExpression"<br>
FooterText="FooterText"<br>
HeaderImageUrl="url"<br>
HeaderText="HeaderText"<br>
NavigateUrl="url"<br>
ReadOnly="True|False"<br>
SortField="DataSourceFieldToSortBy"<br>
Target="window"<br>
Text="HyperLinkText"<br>
Visible="True|False"/><br>
<br>
<asp:TemplateColumn<br>
FooterText="FooterText"<br>
HeaderImageUrl="url"<br>
HeaderText="HeaderText"<br>
ReadOnly="True|False"<br>
SortField="DataSourceFieldToSortBy"<br>
Visible="True|False"><br>
<br>
<HeaderTemplate><br>
Header template HTML<br>
</HeaderTemplate ><br>
<ItemTemplate><br>
ItemTemplate HTML<br>
</ItemTemplate><br>
<EditItemTemplate><br>
EditItem template HTML<br>
</EditItemTemplate><br>
<FooterTemplate><br>
Footer template HTML<br>
</FooterTemplate><br>
<br>
</asp:TemplateColumn><br>
</Columns><br>
<br>
</asp:DataGrid>
原文转自:http://www.ltesting.net