AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 27.03.2019, 01:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
How to get number of rows loaded in a grid
Источник: http://alexvoy.blogspot.com/2019/03/...d-in-grid.html
==============

In fact we can use numberOfRowsLoaded on a linked form data source; however, it shows the number of those cached only.

So, if you are editing row number 28, for example, and then call ExecuteQuery() on the data source, you will probably get a lower number of rows loaded in the grid yet, say, 19.

In order to get the right number, you should use the aforementioned method together with allRowsLoaded() one.

public int wblNumberOfRowsLoaded()
{
int wblNumOfRec;
int wblCounter;

wblNumOfRec = PSAActivityEstimates_DS.numberOfRowsLoaded();
// nothing to load yet
if(!wblNumOfRec)
{
return wblNumOfRec;
}
// so far we numbered those lines cached only
while(!PSAActivityEstimates_DS.allRowsLoaded())
{
// so let's move it on until the end of loading
PSAActivityEstimates_DS.setPosition(wblNumOfRec);
PSAActivityEstimates_DS.getNext();
// just to avoid never ending adventure
if(wblCounter>1000)
{
break;
}
wblCounter++;
// get the number for the next iteration
wblNumOfRec = PSAActivityEstimates_DS.numberOfRowsLoaded();
}
// now all numberOfRowsLoaded() calls will return the correct number of rows in grids
wblNumOfRec = PSAActivityEstimates_DS.numberOfRowsLoaded();

return wblNumOfRec;
}




Источник: http://alexvoy.blogspot.com/2019/03/...d-in-grid.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ax-erp: How to get AOS Port number in axapta by code Blog bot DAX Blogs 0 19.10.2012 21:12
dax-lessons: How to get the count of number of pages printed on to SSRS report [AX 2012 , X++] Blog bot DAX Blogs 0 16.08.2012 21:12
Dynamics CRM Tools: How to colorize grid rows… Blog bot Dynamics CRM: Blogs 0 27.01.2012 01:12
Khue Trinh: How to get Inventory On-hand number Blog bot DAX Blogs 17 11.01.2008 22:23
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 12:42.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.