J
jeremy.brewster
Hello
I am attempting to setup the ASP.NET 2.0 GridView to access a business
tier class which will provide data to the GridView, via an object data
source object. My business class returns a strongly typed dataset to
the GridView/object data source (this business tier class delegating
the creation of the data to a data tier) where the dataset is called
CustomDataSet. The business class method is as follows
public CustomDataSet GetRegistrationLevelsByAgeReport()
{
GetRegistrationLevelsByAgeCommand command = new
GetRegistrationLevelsByAgeCommand(this.CustomDataSet);
this.CommandExecutor.Execute(command);
return command.ResultSet;
}
My problem is that the strongly typed dataset contains MULTIPLE
strongly typed data tables, the one that I require being called
"RegistrationLevelsByAgeReports". I want to be able to set the data
binding in such a way that I can inform the object data source to grab
the required data table without breaking the standard pattern for our
business tier methods, which always return a CustomDataSet object, not
the individual required data table. I can do this using the DataSource
property (e.g. this.ReportGridView.DataSource = new
RegistrationManager().GetRegistrationLevelsByAgeReport().RegistrationLevelsByAgeReports)
but I'm attempting to wire up the data source via the object data
source object in order to define paging and caching.
My business class is called RegistrationManager and the select method
that returns data from this business class is called
"GetRegistrationLevelsByAgeReport".
The code for my object data source is:
<asp
bjectdatasource id="ObjectDataSource1" runat="server"
typename="CustomNamespace.RegistrationManager"
selectmethod="GetRegistrationLevelsByAgeReport"></asp
bjectdatasource>
Is there any way to tell an object data source/GridView to define its
data as a child element of a data source (e.g. DataTable object)?
I've tried using the object data source's Object_Creating event but the
problem with this seems to be that the typename in my object data
source is the type of the business object and not the type of the
strongly typed data table.
Any advice would be appreciated.
Thanks
Jez
I am attempting to setup the ASP.NET 2.0 GridView to access a business
tier class which will provide data to the GridView, via an object data
source object. My business class returns a strongly typed dataset to
the GridView/object data source (this business tier class delegating
the creation of the data to a data tier) where the dataset is called
CustomDataSet. The business class method is as follows
public CustomDataSet GetRegistrationLevelsByAgeReport()
{
GetRegistrationLevelsByAgeCommand command = new
GetRegistrationLevelsByAgeCommand(this.CustomDataSet);
this.CommandExecutor.Execute(command);
return command.ResultSet;
}
My problem is that the strongly typed dataset contains MULTIPLE
strongly typed data tables, the one that I require being called
"RegistrationLevelsByAgeReports". I want to be able to set the data
binding in such a way that I can inform the object data source to grab
the required data table without breaking the standard pattern for our
business tier methods, which always return a CustomDataSet object, not
the individual required data table. I can do this using the DataSource
property (e.g. this.ReportGridView.DataSource = new
RegistrationManager().GetRegistrationLevelsByAgeReport().RegistrationLevelsByAgeReports)
but I'm attempting to wire up the data source via the object data
source object in order to define paging and caching.
My business class is called RegistrationManager and the select method
that returns data from this business class is called
"GetRegistrationLevelsByAgeReport".
The code for my object data source is:
<asp
typename="CustomNamespace.RegistrationManager"
selectmethod="GetRegistrationLevelsByAgeReport"></asp
Is there any way to tell an object data source/GridView to define its
data as a child element of a data source (e.g. DataTable object)?
I've tried using the object data source's Object_Creating event but the
problem with this seems to be that the typename in my object data
source is the type of the business object and not the type of the
strongly typed data table.
Any advice would be appreciated.
Thanks
Jez