Subscribe:

Pages

May 10, 2009

ListView Pagination Error and Hiding pagination for no results

Issue 1: List View Pagination  Works only for Second click of  Page index

Description:I am using listview with datapager control. But Datapager is showing pages only when i click the page index for the second time.

Resolution: Call List view databind method in page prerender event

eg:

       protected void Page_PreRender(object sender, EventArgs e)

        {

            listLibrary.DataBind();

        }

Issue2: DatePager Control was showing 1-0 0f 0 when no records was found

Description: i was using Data pager control outside the listview control so it was visible even when there were no records in listview.

Resolution : I moved the DataPager inside the Listview Layout Template and Added EmptyDataTemplate with msg ‘no records found’ text.

0 comments:

Post a Comment