THESE FORUMS ARE NOW FROZEN
Please choose "Forums" from the Main menu of www.entityspaces.net to get to our new forums.

How to show total # of records from esDataSource Control

rated by 0 users
This post has 1 Reply | 2 Followers

Top 150 Contributor
Posts 17
blreese Posted: 03-26-2009 10:26 PM

I have an esDataSource control which a GridView control is bound to.  The esDataSource handles the total record count as well as the current (20) rows that should be displayed when paging.  Unfortunately, I am unable to show the count of this in my grid.  for example, I want it to say "Showing records 20-40 of 684" in the footer of the gridview.  does the esDataSource control return this property?  How can I do this?  I can't find it...I am sure hte answer is easy to you guys, I just dont know where it is.

Thank you,

Br

Top 10 Contributor
Posts 905

You can access the values needed to construct paging text in the esPostSelect event like so

 

Code:
protected void EsDataSource1_esPostSelect(object sender, EntitySpaces.Web.esDataSourceSelectEventArgs e)
{
	var emps = e.Collection as EmployeesCollection;

	if (emps != null)
	{
		int count = emps.Count;
		int pageNumber = emps.Query.es.PageNumber;
		int pageSize = emps.Query.es.PageSize;
	}
}

Regards, Scott Schecter EntitySpaces | Blog | Twitter

Page 1 of 1 (2 items) | RSS
Copyright © 2005 - 2009, EntitySpaces, LLC