Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to ask if some do not face this requirement:

Client wants to have search fully configurable by taking properties from SPFarm bag. This means that he wants to set up number of results per page in search result form for example.

I overridden ConfigureDataSourceProperties method and in this method I am assigning value to ResultsPerPage property. However this is probably late because it take value that is set in the text box of web part settings. So my question is where I should set the ResultsPerPage property? I would like to ignore text in OOB Results per page text box. I also don't want to use the approach with checking-out the page, taking the web part manager etc .. Is there an option?

Thanks a lot.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

well after closer look i found the solution.

var dataSource = DataSource as CoreResultsDatasource;
dataSource.ResultsPerPage = desiredResultsPerPage

I also set

this.ResultsPerPage = desiredResultsPerPage

however I dont know if this step is needed :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.