My master radgrid holds Locations and has a primary key of Location_ID
The details table below holds Activities related to the selected Location.
The datasource for the Activity grid included the act_Location_ID in it's where clause, like this.
All this works 100%. Clicking a Location updates the list of Activities and everyone is happy. :)
However, this page is a search (filter) page. That is, by setting values on a form you can limit the number of locations. Despite this the Location and Activity work in unison. The Activity table shows you the activities for the selected Location.
That is unless your filtering results in NO location returned. In this case the problem begins.
If there is no Locations returned, the Activity grid defaults to showing EVERY activity in the database, regardless of Location ID.
This is a show stopper. Why in the case of there being no Locations returned, does my Activity table disregard the Location ID WHERE clause in its DataSource and return all Activities?
The details table below holds Activities related to the selected Location.
The datasource for the Activity grid included the act_Location_ID in it's where clause, like this.
WHERE act_Location_ID = @loc_Location_ID
All this works 100%. Clicking a Location updates the list of Activities and everyone is happy. :)
However, this page is a search (filter) page. That is, by setting values on a form you can limit the number of locations. Despite this the Location and Activity work in unison. The Activity table shows you the activities for the selected Location.
That is unless your filtering results in NO location returned. In this case the problem begins.
If there is no Locations returned, the Activity grid defaults to showing EVERY activity in the database, regardless of Location ID.
This is a show stopper. Why in the case of there being no Locations returned, does my Activity table disregard the Location ID WHERE clause in its DataSource and return all Activities?