Highlighted
Absent Member.
Absent Member.
1944 views

Public Class for a WPF Data Grid

Hi I Need a public Method like this in C#:

    public class WPFGridZeilen     {         public string GrSp01 { get; set; }         public string GrSp02 { get; set; }     }

It's a public Class in a C# EXE File

And with this i can get/set Data in a WPF DataGrid...

 

Best Regards

Bernd Riemke

0 Likes
6 Replies
Highlighted
Absent Member.
Absent Member.

RE: Public Class for a WPF Data Grid

This C# code is better ...

   public class WPFGridZeilen

   {

       public string GrSp01 { get; set; }

       public string GrSp02 { get; set; }

   }

Best Regards

Bernd Riemke

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Public Class for a WPF Data Grid

What is it in Cobol ?

Best Regards

Bernd Riemke

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Public Class for a WPF Data Grid

There is an entire section in the documentation that shows comparisons of various OO programming features between different languages like COBOL and C#.

Please see http://documentation.microfocus.com/help/index.jsp?topic=%2Fcom.microfocus.eclipse.infocenter.visualcobol.vs%2FGUID-3C495CA9-2B7A-4890-AC64-005545AED543.html

Look under Properties as this is what you are describing here.

Thanks.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Public Class for a WPF Data Grid

Here is one example of a get / set in Visual COBOL.  There are a couple of other ways to do this.

class-id WPFGridZeilen.

working-storage section.

  01 _grso01 string.

      property-id GrSp01 string.  

      getter.

          set property-value to _grso01

      setter.

          set _grso01 to property-value

      end property.

end class.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Public Class for a WPF Data Grid

Something is not 100% right...See this: (c#)

I found no Way for this in Cobol:

                   GridList.Add(new WPFGridZeilen()

                   {

                       GrSpalte01 = "Hello 01!,

                       GrSpalte02 = "Hello 02!,

                   }

Here is the WPFGridZeilen Code:

      class-id WPFGridZeilen.

      working-storage section.

       01 _grso01 string.

       01 _grso02 string.

           property-id GrSpalte01 string.  

                   getter.

                   set property-value to _grso01

                   setter.

                   set _grso01 to property-value.

           end property.

           property-id GrSpalte02 string.  

                   getter.

                   set property-value to _grso02

                   setter.

                   set _grso02 to property-value.

           end property.

     end class.

Best Regards

Bernd Riemke

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Public Class for a WPF Data Grid

The 2.2 version of Visual COBOL does have support for property initialization as part of a 'new' expression.

Try something like:

      01 o type WPFGridZeilen.

      set o to new WPFGridZeilen(property GrSpalte01 = "Hello 01"

                                 property GrSpalte02 = "Hello 02")

          display o::GrSpalte01

          display o::GrSpalte02

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.