API
Version 7.x > API > Setting page for repeater after filter criteria changes View modes: 
User avatar
Member
Member
uday.shelar-gmail - 12/26/2012 5:18:27 AM
   
Setting page for repeater after filter criteria changes
Hi,
I have news page added in the CMS. This page contains dropdown for ALL News / year wise news. When I choose any of the year it displays news for that year. We have used the updatepanel to bind the news, Also pager mode is postback.

Suppose I have choosed news year as 2012 and selected the page 5. it displays the 5th page news.

When I change the filter criteria for e.g 2011, I am getting the news for the year 2011 but the selected page is remains the same as 5th page. I would like to set the page 1 as selected page whenever I will change the filter criteria.

any help will be appreciated.


Thanks,
Uday Shelar.

User avatar
Member
Member
kentico_jiris - 1/2/2013 3:45:15 AM
   
RE:Setting page for repeater after filter criteria changes
Hi,
short answer is that you should be able to bind an event handler to change index event of drop-down list and set current page of the pager in code.
The code should like this:

// Event handler registration
ddlYear.SelectedIndexChanged += SelectedYearChanged;

// Event handler
protected void SelectedYearChanged(object sender, EventArgs eventArgs)
{
pager.CurrentPage = 1;
}

However if you already tried this and it does not work, I would suggest to try adjusting update panel settings / content.

Since it looks like what you need is short tip, I did not try to reproduce your situation, so if you need further assistance, please let us know and provide us further information.