4

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?

4

1 に答える 1

3

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.

データ バインド コントロールはページングを使用していますか?

于 2010-03-02T21:35:04.770 に答える