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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 03.09.2009, 17:18   #1  
Kent is offline
Kent
Участник
 
46 / 10 (1) +
Регистрация: 24.01.2007
Container in Grid
I have problems while showing the content of the container in the grid.
My datasource has two field. First field is the id of type string and the second of type container.

You can answer in Russina.
Старый 03.09.2009, 18:23   #2  
plumbum is offline
plumbum
Участник
Соотечественники
 
182 / 86 (3) ++++
Регистрация: 07.12.2007
Адрес: Vienna, AT
Which problems do you have?
Stack trace or just wrong displaying?
__________________
http://www.axdevposts.blogspot.com
Пришел, уведел.... отойди, дай другому увидеть!
За это сообщение автора поблагодарили: Kent (1).
Старый 04.09.2009, 11:01   #3  
Kent is offline
Kent
Участник
 
46 / 10 (1) +
Регистрация: 24.01.2007
I have problem with displaying. Axapta tray display it as image and I got an error. That is the problem.
I have code: I collect data from ListView and insert it in container, and container I post in table. 'Field' have extended data type "Container".

X++:
    container    con;
    Set          set = new Set(Types::String);
    ;

    idx = ListSelected.getNextItem(FormListNext::All);
    while (idx != -1)
    {
        item = ListSelected.getItem(idx);
        set.add(item.data());
        idx = ListSelected.getNextItem(FormListNext::All, idx);
    }
    con = [set.pack()];
    table.Field= con;
    table.insert();
After this, in table in container field I got this result: The question is - how to display this in Grid ?
Миниатюры
Нажмите на изображение для увеличения
Название: container.JPG
Просмотров: 663
Размер:	77.4 Кб
ID:	5092  

Последний раз редактировалось Kent; 04.09.2009 в 11:05.
Старый 04.09.2009, 12:19   #4  
plumbum is offline
plumbum
Участник
Соотечественники
 
182 / 86 (3) ++++
Регистрация: 07.12.2007
Адрес: Vienna, AT
This is not a problem - system doesn't know how to display your container, that's why it populates it it the tree view.

This is redundant:
X++:
con = [set.pack()];
table.Field= con;
You need only this:
X++:
table.Field= set.pack();
As I can see you don't know for sure, how many rows you'll get selected in List view
If you want to display selected items in grid, you will have to create child table and join it with parent using specified key. Child table will contain records with selected list view items.
Also you can display rows, creating another list view or tree view, depending on what you need.

If you describe the purpose of displaying container in grid in detai, solution can be more obvious
__________________
http://www.axdevposts.blogspot.com
Пришел, уведел.... отойди, дай другому увидеть!
Старый 04.09.2009, 12:36   #5  
Kent is offline
Kent
Участник
 
46 / 10 (1) +
Регистрация: 24.01.2007
I don't use child table, because I have more ListViews with different data. Example, I select 3 rows from ListView 1, and example 1 row from ListView2. And than I get in table following:

X++:
id     Field 1.....................Field2
1      ListView1<field>       
2      ListView1<field> 
3      ListView1<field>
4..................................ListView2<field>
If I have example 6 ListViews, this table looks terrible. Therefore I wanted post selected fields in containers, to insert all info in one row.

Maybe are different way to solve this?

Последний раз редактировалось Kent; 04.09.2009 в 12:38.
Старый 04.09.2009, 12:52   #6  
Gustav is offline
Gustav
Moderator
Аватар для Gustav
SAP
Лучший по профессии 2009
 
1,858 / 1152 (42) ++++++++
Регистрация: 24.01.2006
Адрес: Санкт-Петербург
Записей в блоге: 19
May be convert your container to string with using function Global::con2str? And then use display method for showing result string in grid. Before showing result string can be arranged with some additional chars, just like LF, CR etc.
Старый 04.09.2009, 12:52   #7  
plumbum is offline
plumbum
Участник
Соотечественники
 
182 / 86 (3) ++++
Регистрация: 07.12.2007
Адрес: Vienna, AT
You can provide table with the next structure:
Field 1 - Type of list view (enum), for instance, ListView1, ListView2
Field 2 - Value (string) - selected item text
__________________
http://www.axdevposts.blogspot.com
Пришел, уведел.... отойди, дай другому увидеть!
Старый 04.09.2009, 13:00   #8  
Kent is offline
Kent
Участник
 
46 / 10 (1) +
Регистрация: 24.01.2007
Thank You plumbum and Gustav. I will try this ways.
Теги
container, grid

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axaptapedia: Filter-by-Grid Blog bot DAX Blogs 2 30.05.2012 13:39
Dynamics AX: DAX 4.0 Filter by Grid [Update] Blog bot DAX Blogs 0 27.04.2007 17:10
axaptapedia: Container Blog bot DAX Blogs 0 06.03.2007 00:33
Dynamics AX Geek: Storing objects in a container Blog bot DAX Blogs 0 28.10.2006 16:40
Advanced programming: Grid data and view manipulations batiskaf_new DAX: Программирование 15 21.06.2006 11:44

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

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

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