The EntitySpaces Community

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

esDataSource suggestions

Last post 02-22-2008, 11:13 AM by Stupid2Rules. 12 replies.
Sort Posts: Previous Next
  •  10-25-2007, 2:28 PM 6075

    esDataSource suggestions

    Is it possible for EsDataSource to:

    • Set TotalRowCount automatically?
    • Provide a default sort expression when none is provided if (when AutoSorting="true")?
    • Handle paging and sorting automatically based on the control that it is connected to?  E.g. if the control was set for Paging then it would esDataSource would automatically do paging, etc...

    FYI, I provided a sample Telerik Grid that handles Paging, Sorting and Exporting Here.  Any feedback on ways to improve it would be appreciated.

    Also, if anyone else has suggestions, please feel free to chime in ...

  •  10-27-2007, 10:11 AM 6115 in reply to 6075

    Re: esDataSource suggestions

    Support for Circular references would be great!  e.g. User - organization relationships.  Maybe this being addressed for hierarchical...

  •  10-27-2007, 10:31 AM 6116 in reply to 6115

    Re: esDataSource suggestions

    I have linked to this thread from our tracking system. I can't promise anything, but we will certainly consider them as we head into the home stretch for ES 2007.
    David Neal Parsons
    www.entityspaces.net
  •  11-09-2007, 2:54 AM 6395 in reply to 6075

    Re: esDataSource suggestions

    Stupid2Rules:

    Is it possible for EsDataSource to:

    • Set TotalRowCount automatically?

    This would be great. I hate having to build and issue a query twice (once to calculate the total number of rows and once to retrieve the data). It's a pain for all but the simplest of queries.

    In my current project, I have to build fairly complex search queries to filter the results. Having to build and issue the SQL twice seems excessive.


    Leigh
  •  11-20-2007, 7:20 PM 6759 in reply to 6395

    Re: esDataSource suggestions

    ES Team - really sorry to see that it looks this didn't get into the release.

    In particular, I'm thinking TotalRowCount is required for automatic functions and filtering to function properly.  Setting it manually once in the Page_Load means that it's incorrect once you add/delete.  BTW, I tried updating it in the esPostSelect - but to update the grid you have to rebind and rebind causes a re-select and you've got an infinite loop - until the application restarts:-).  Is there another way???

    FYI - here's a post that shows an implimentation for IReportTotalRowCount (Paging & Sorting): http://forums.lhotka.net/forums/17220/ShowThread.aspx.  It's a different context but maybe it'll help perfect the esDataSource.

  •  11-21-2007, 8:15 AM 6765 in reply to 6759

    Re: esDataSource suggestions

    Further to the link in the prior post, it also notes that it's possible to recognize when paging is not being requested by looking at SelectObjectArgs.  And if I'm reading it correctly, a bit further down shows an example to deal with the 3 states (ASC, DESC, nothing) that Telerik uses (vs MS GridView) that I mentioned in an earlier post that was also ignored.  Below that it is a check for NULL sort expression.
  •  11-21-2007, 8:25 AM 6766 in reply to 6765

    Re: esDataSource suggestions

    This is some great information, we are definitely going to look at this, if we can make it even easier to use then we will. I think you might be onto something here, perhaps we can set the row count and detect paging and or sorting automatically.  Wow, that would make for an incredibly simple but sophisticated web page. Thanx for the input.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  01-08-2008, 7:21 AM 7497 in reply to 6766

    Re: esDataSource suggestions

    Mike,

    Have you given any more thought to automatically obtaining/setting the row count? Is this something we might see soon?

    I'm using the esDataSource quite a lot in my current project, and having to set this manually is a pain (as I have some fairly complex queries that have to be issued twice).

    Thanks
     


    Leigh
  •  01-08-2008, 7:23 AM 7498 in reply to 7497

    Re: esDataSource suggestions

    Yes, we are going to add this but the first release of ES2008 is a ways off, we're thinking the March or April time line.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  01-19-2008, 10:38 AM 7701 in reply to 7498

    Re: esDataSource suggestions

    Thanks Mike - this will be Awesome!

     A couple of thoughts on setting TotalRowCount:

    1. In order to set TotalRowCount autmatically, I suspect ES will need to:
      1. FIRST strip any select statements out of the query
      2. THEN add the <EntityQuery>.Select(<EntityQuery>.PrimaryKey.Count().As("TotalRowCount")); statement. 

        The reason is that if the query includes a join with another table and any of the columns from the other table are selected, you'll end up with a run-time error when you add the add the Select...Count statement.
    2. The way I've worked around this for now is (see an example here):
      1. I have a method which builds the query except for the Select statements
      2. In the RadGrid1_DataBinding event handler, call the Build Query method, add the Select...().As("TotalRowCount")), Load() and set EsDataSource1.TotalRowCount = (int)<EntityQuery>.GetColumn("TotalRowCount");  This is the only place I set TotalRowCount (it's no longer in Page_Load).
      3. In the EsDataSource1_esSelect event handler, call the Build Query method, add in the selects for whatever columns I need in the collection, and then assign the query to the (esDataSourceSelectEventArgs) e.Query.

    BTW, the reason I asked for SelectCountMethod to be added in this post is as a backup in case you're not able to add support for setting TotalRowCount automatically.

  •  02-20-2008, 9:17 AM 8148 in reply to 7498

    Re: esDataSource suggestions

    Hi Mike,

    I just wanted to check back to see:

    1. Will "automatically setting the row count" will make it into the "first release of ES2008"?
    2. If not, how about "SelectCountMethod"?
    3. Did the post above (7701) made any sense?

    Thanks,

    Jeff.

  •  02-21-2008, 4:46 AM 8154 in reply to 8148

    Re: esDataSource suggestions

    Yes, we are addressing this. Scott is tackling this one, it will be in the ES2008 beta.

    EntitySpaces | Twitter | BLOG | Please honor our Software License
  •  02-22-2008, 11:13 AM 8165 in reply to 8154

    Re: esDataSource suggestions

    Great, thanks.
View as RSS news feed in XML