The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Is it possible to cancel a select on a esDataSource object

Last post 05-30-2008, 8:40 AM by DanM. 2 replies.
Sort Posts: Previous Next
  •  05-30-2008, 2:40 AM 9544

    Is it possible to cancel a select on a esDataSource object

    Hi there,

    I've got a GridView being bound to an esDataSource on a page. what I would like to happen is the data source to retrieve data from teh database only when certain conditions are met elsewhere on the page. Now if I was using a SqlDataSource, I would handle its Selecting event, check the conditions and then call Cancel() if they weren't met.

    I was expecting to be able to do the same using the esDataSource's esPreSelect event, but there's no sign of a cancel method anywhere, nor in the esSelect event. can you tell me if it is possible please or if I'll have to strip out the esDataSource and select the data and bind the field in the code-behind instead.

    Thanks, Dan

    Filed under:
  •  05-30-2008, 5:55 AM 9548 in reply to 9544

    Re: Is it possible to cancel a select on a esDataSource object

    That is a very good idea. I will play with this and see if we can sneak this in. Just out of curiosity, what happens if you do nothing in the esSelect event? Does the grid show up empty?

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  05-30-2008, 8:40 AM 9557 in reply to 9548

    Re: Is it possible to cancel a select on a esDataSource object

    Nothing useful. I need to show a grid containing users and their distance from a location but the location needs to be entered first by the user. Easiest thing to do would be set the GridView's nodatatemplate to say "select a location and go" rather than displaying a load of data that shouldn't be retrieved in the first place.

View as RSS news feed in XML