`
yake2011
  • 浏览: 18187 次
最近访客 更多访客>>
社区版块
存档分类
最新评论

SPGridView: Adding paging to SharePoint when using custom data sources

 
阅读更多
原文链接

 

Part 2: Extending your SPGridview with paging controls

 

and add the event handler:

 

 

void oGrid_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            oGrid.PageIndex = e.NewPageIndex;
            oGrid.DataBind();
        }

 

 

The extra lines around sorting are important if you enabled sorting on the list in Part 1. Adding the paging means CreateChildControls() could now fire on a postback without a subsequent call to oGrid_Sorting(). Depending on how you’re implementing state, this could mean the list switches back to being unsorted – giving the impression of duplicating or missing out entries if you sort before you page, so to speak.

Enjoy.

  • 大小: 22.3 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics