开发者

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();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜