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

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"/>
</property>

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?

Thanks

share|improve this question
    
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
    
I see, thanks for the help Tezza! –  Sabry May 9 '12 at 5:33

1 Answer 1

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";
share|improve this answer

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.