problems with ObjectDataSource and filtering

B

ber.janssens

Hi,

I am trying the new ObjectDataSource from ASP.NET 2.0. I connected a
Gridview with ObjectDataSource which is connected to a webservice which
returns a DataSet. In the Webmethod I return only the rows for the
current page because paging is enabled, I use the parameters
maximumRows and startRowIndex for doing this. I also got sorting to
work using the parameter sortExpression.

The method of the webservice looks like this:

[WebMethod(Description = "")]
public DataSet GetDataSet(int maximumRows, int startRowIndex, string
sortExpression)
{
....

return dsPagedPortCodes;
}

[WebMethod(Description = "")]
public int GetNumberOfRows()
{
....

return ds.Tables[0].Rows.Count;
}

The description of the ObjectDataSource looks like this:

<asp:ObjectDataSource
ID="ods" runat="server" MaximumRowsParameterName="maximumRows"
StartRowIndexParameterName="startRowIndex"
SortParameterName="sortExpression"
EnablePaging="True" SelectMethod="GetDataSet"
SelectCountMethod="GetNumberOfRows"
TypeName="WSService.wsWebservice"
</asp:ObjectDataSource>

Paging and sorting works but now I want to be able to get filtering
works, the returned DataSet contains one table with 4 columns and I
want to be able to filter on each column.

What do I have to change to the webmethod and the ObjectDataSource to
get filtering to work?

Thanks a lot,
kind regards,
Bert Janssens
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top