I have an EntityDataSource with OnSelected
event (fired after finished query). The event handler has event args of type EntityDataSourceSelectedEventArgs e
. Query runs fine without error and the IEnumerable e.Results
contains 1 object (I can run through a non-empty foreach-loop) but e.TotalRowCount
returns -1
.
Does somebody have an idea what this means and what information TotalRowCount
actually expresses? How can I determine the number of selected objects if not by using TotalRowCount
?
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 data-bound control using paging?