EntityDataSource: TotalRowCount returns -1. What is it?

I have an EntityDataSource with the OnSelected event (fired after a finished request). The event handler has args events of type EntityDataSourceSelectedEventArgs e . Query works fine without errors, and IEnumerable e.Results contains 1 object (I can run a non-empty foreach loop), but e.TotalRowCount returns -1 .

Does anyone have an idea what this means and what information TotalRowCount really expresses? How to determine the number of selected objects, if not using TotalRowCount ?

+4
source share
1 answer

From http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.entitydatasource.selected(VS.100).aspx :

  The TotalRowCount property of the EntityDataSourceSelectedEventArgs object shows the total number of objects in all pages, regardless of the values passed by the data-bound control for paging. TotalRowCount is only retrieved if the data-bound control needs it, such as if paging is enabled. 

Is your control of data binding using swap?

+3
source

Source: https://habr.com/ru/post/1302913/


All Articles