Hello,
I would like to understand how I can set the default values of a checkbox multiselect dropdown component using a value retrieved from a database column. I understand that this is possible to do by hard coding the values like this:
public int?[] EmployeeValue { get; set; } = { 1, 2 };
My column values are delivered as a string, however, the actual value needed is an int. Some examples of returned values would be: 1 OR 1, 2 OR 1, 2, 3 ,etc. I can split the values if needed, but I'm not clear on how to deliver them to the array.
What I functionally need is this:
string x = "1, 2, 3" (result from db)
public int?[] EmployeeValue { get; set; } = { x };
This is obviously oversimplified; I wish it was that easy...
Thanks