Skip to main content

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

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

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


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

Werner,

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

Thanks.


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

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


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

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?


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

Code uploaded as Word Docoment

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

Solution as Zip