ObjectDataSource sets MaximumRowsParameterName= -1

oscarrabbit

New Member
I have a GridView and an ObjectDataSource\[code\]<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" TypeName="myType" SelectMethod="FindByName" MaximumRowsParameterName="NumRows" StartRowIndexParameterName="RowStart" EnablePaging="true"> <SelectParameters> <asp:Parameter Name="namex" Type="String" Direction="Input" DefaultValue="" /> <asp:Parameter Name="RowStart" Type="Int32" Direction="Input" DefaultValue="http://stackoverflow.com/questions/15776558/0" /> <asp:Parameter Name="NumRows" Type="Int32" Direction="Input" DefaultValue="http://stackoverflow.com/questions/15776558/15"/> </SelectParameters>\[/code\]Everyting seems to work fine.But when i change page on GridView and the ObjectDataSource calls the method it sends the parametter NumRows=-1(StartRowIndexParameterName="NumRows").If i call ObjectDataSource.Select() it sends NumRows=0even if i set a value to the parameter NumRows\[code\]Protected Sub ObjectDataSource_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles ObjectDataSource.Selecting e.InputParameters("NumRows") = 15End Sub\[/code\]ObjectDataSource still sends -1 or 0.To parameter RowStart it sends the right value(click page 1 sends 0, click on page 2 sends 15...)
 
Back
Top