Is it possible to use ParamaterBinding for MaximumRows?

The following does not work.

Following set in SelectParmaters

<webpartpages:DataFormParameter ParameterKey="MaximumRows" PropertyName="ParameterValues" DefaultValue="1" Name="MaximumRows"></webpartpages:DataFormParameter>

Following bindings configured

<property name="ParameterBindings" type="string">
<ParameterBinding Name="MaximumRows" DefaultValue="3"/>

Changing the binding as you can see has no impact at all on the webpart. It remains showing 1 as set in the default.

This paramaterbinding works fine for WebUrl and ListName but seems to not work for MaximumRows. Can others confirm?


  • I'm having the same issue that you have experienced. I'm hoping you've already solved this issue, if so, could you please tell me how you did it? Sabry – Sabry May 8 '12 at 11:16
  • Not the answer you want I'm sure, but I had to go with removing the binding for maximum rows and had to use a static parameter instead. No end user flexibility I'm afraid! – Tezza May 8 '12 at 16:06

One option is to aggregate the XSLTListViewWebPart, like this:

var xlcwp = new XsltListViewWebPart { ListId = myList.ID };
var ds = xlcwp.DataSource as SPDataSource;
if (ds == null) return;

var maximumRows = ds.SelectParameters["MaximumRows"];
if (maximumRows == null) return;

maximumRows.DefaultValue = "3";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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