use a listview with a sort combobox and a number of items on a page combobox
Can s开发者_高级运维omeone give a hint how to use a listview with a sort combobox and a number of items on a page combobox? I am manually databinding the ListView control on init when there is no postback, and I also databind it when any combobox changes (they have AutoPostBack == true). Seems to work, but when I use the attached pager control, then other pages just don't get selected.
The PreRender event in the DataPage should be binding your data.
<asp:DataPager ID="MyDataPager" runat="server" PagedControlID="YourListViewControlName"
PageSize="3" OnPreRender="MyDataPager_PreRender">
protected void DataPagerProducts_PreRender(object sender, EventArgs e)
{
YourDataList db = new YourDataList();
this.YourListViewControlName.DataSource = db.GetAll(); // just an example method
this.YourListViewControlName.DataBind();
}
精彩评论