0

I have two projects in my solution:

  1. The API: https://github.com/foxip/mollie-api-csharp
  2. The project where Iretrieve and send data from and to my API

I want to fill a ComboBox with methods but when i try to do it how they say I should, it doesn't work. This is what I tried:

using Mollie.Api;

// ...

MollieClient mollieClient = new MollieClient();
mollieClient.setApiKey("test_1234");

Method methods = new Method();
methods = Mollie.Api.Method.all();

Under all there is a red line saying:

Error 1 'Mollie.Api.Method' does not contain a definition for 'all'

When I write Mollie.Api.Method.*, the helper gives me then all the possible methods at *, but how can I get them automatically into my ComboBox?

EDIT: this works for me: cboMethod.DataSource = Enum.GetNames(typeof(Method));

extreme4all
  • 326
  • 1
  • 3
  • 16
  • It is not quite clear what are you trying to achieve. Do you want to get list of some class methods (say, through reflection)? – Andrey Korneyev Mar 18 '15 at 07:55
  • Looking at his question history, he's talking about mollie-api-csharp and [`Method` is an enum](https://github.com/foxip/mollie-api-csharp/blob/master/Mollie.cs#L43). – cbr Mar 18 '15 at 07:57
  • yes, you are right @GrawCube i want to get those payment methods in my combobox so my customer can choose one, i am sorry that i may ask really obvious things but i am not really expierienced in C# – extreme4all Mar 18 '15 at 07:58
  • possible duplicate of [Binding an enum to a WinForms combo box, and then setting it](http://stackoverflow.com/questions/906899/binding-an-enum-to-a-winforms-combo-box-and-then-setting-it) - see the answer with most votes for your solution: http://stackoverflow.com/a/9541156/996081 – cbr Mar 18 '15 at 08:01
  • after alot of searching i found the answer i needed: `cboMethod.DataSource = Enum.GetNames(typeof(Method));` – extreme4all Mar 18 '15 at 09:22

0 Answers0