How to print functions in a DataGridView?

0

I have a form with a class where the variables are and also functions.

To show them in the DataGridView use

DataGridView.DataSource = List<T>;

But I also want the functions to be shown, for example

The sum of two data that are in the class

(The functions are already created)

    
asked by Leonel Salcedo Retamozo 20.09.2018 в 02:21
source

1 answer

0

You can use the getter of a property to do it, an example, it could be something like that

    public int Suma
    {   get
        {
            return FuncionEjemplo();
        }
    }

    public int FuncionEjemplo()
    {
        return 1 + 2;
    }

Greetings!

    
answered by 20.09.2018 в 02:34