Skip to main content

Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

If you show me the C# code you use I will convert it to COBOL.


Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

Something like this.

Just typing out of my head im sure theres some erros.

foreach(GridViewRow row in dgCaregories.Rows)

{

      // Get the Checkbox cell value

}


Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

Something like this:

perform varying row as type GridViewRow thru dgCategories::Rows

    *> Get the Checkbox cell value

end-perform

This is documented in the language comparison chart here:

Look at example for Loops or how to iterate thru a collection


Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

i get "System.Windows.Controls.DataGrid' has no member with name 'Rows'

perform varying row as type System.Windows.Controls.DataGridRow thru dgCategory::Rows

   *> Get the Checkbox cell value

end-perform


Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

DataGrid is based on ItemsControl, so use dgCategory::Items.

Why are you not using Binding, which gives you all values in a simple collection with a condition-value for the checkbox?


Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

I only converted your original C# example which must be for a Windows Forms dataGridView control instead of a WPF dataGrid control which is different.

The WPF dataGrid control does not have a Rows property as the error indicates.

What type of application are you creating, WinForms, WPF, ASP.NET?


Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

Its WPF. I set the datagrid itemSource to the list of  categories. Then add the column of checkboxes to select wich categories I want to pick. So far so good. The problem is that i cant find how to read the categories with checked box.

the category object is just CategoryID and Category Name.


Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

Here is an example which uses 2way binding on an observable collection. After the checks are done and a button is clicked it will read back thru the collection and display the checked items in a separate listbox.


Hello

Currently I have a datagrid with 3 columns, ID - Name - Selected.  The Selected column is a checkbox column. Im triying to fing a way to get all items in the datagrid with the Selected colum checked. I can do this in C# easy  but cant figure it out in visual cobol.

Thanks for the help !

Thanks ! and sorry for not being clear.