Highlighted
Absent Member.
Absent Member.
2702 views

VisualCobol: Populate WPF DataGrid

Hello, I am new to the Visual (Cobol) / WPF World (coming from ACU-Cobol).

I tried to find a Sample that demonstrates how to fill a WPF DataGrid (NOT DataGridView!!) from a file. I tested 2 different ways to populate the DG but None of them worked - here are them:

1.

- read a file called "VER01" (employees)
- filling a list with the Name, shortname and the number
- read next entry of file - filling list ...
- set the list (LISTBOX) to ItemsSource of Datagrid (LB1)
- DataGrid is empty although the List is filled correctly

Code

2.

- read file called "VER01" (employees)
- fill a Single-line-Array (LB1X) with entries from VER01 and
- directly try to add this line to the DataGrit (Invoke LB1::Items::Add(LB1X)
- The DataGrid is populatetd with the correct number of rows (concerning to the entries in the file) but the DataGrid has no content

Code

I really tried to find samles/help in the documentation, Forums, wikis, Google but could not find something that helps ... can anyone help please?

THX kathrin

0 Likes
6 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: VisualCobol: Populate WPF DataGrid

Hallo

Wenn Sie mir Ihre Mail-Adresse bekannt geben kann ich Ihnen eine kleines WPF-Beispiel mit einem DataGrid zustellen. Es ist ein Beispiel zur Dokumentation eines Binding-Fehlers für Culture de-CH.

Freundliche Grüsse

Werner Lanter

E-Mail: werner.lanter@lanter-edv.ch

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: VisualCobol: Populate WPF DataGrid

Werner,

Can I please ask that you post your example directly to this forum so that others may share this information?

Thanks.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: VisualCobol: Populate WPF DataGrid

Chris

I get an error when trying to upload the zipped solution, size 638KB. You can also find the file on incident #2793787, WPFApplDataGrid_2.zip.

Freundliche Grüsse

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: VisualCobol: Populate WPF DataGrid

Yes, that file is too large to upload to this forum.

Would it be possible to copy/paste just the relevant XAML and COBOL code to show how the binding is established?

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: VisualCobol: Populate WPF DataGrid

Code uploaded as Word Docoment
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: VisualCobol: Populate WPF DataGrid

Solution as Zip
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.