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
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