Hi TTN,
In your case for data populating purposes, The only thing you need to do is define a data-source along with a Key and a Display property. As you have it in '|' Seprated value in string, this could be done by creating a service method, which will split data and Add it as key and value.
Eg:
string commaSepratedValue = "Item1| Item2|Item3|Item4"; Split it to array and then add to list using loop var checkBoxList= new List(); for(var item in commaSepratedValue.Split('|')) { checkBoxList.Add(new ListData { Key = item , Name = item }); } return checkBoxList; |
The above method will return a list of data object with a Key, and a Name property.
Access the service object method and add it as DataSource.
Please Use Choice control and in Display properties do the following changes
Select Display Type as Check Box List
and Delimiter '|'
This will return ur output as '|' seprated
Hi Kran,
Can you please walk-through the solution you mention. Its hard to understand how exactly it can be implemented. Thanks for your support.
This will be super easy to acomplish....
I suggest:
a) Create a param ( 1 or 2 depending if you want Questions and Answers or only answers )
b) Create a Expression to concatenate the Questions / Answers from the Selection Controls
c) Create and Unbound Rule e On change execute Transfer Data put the value of the Expression in the Param ]
At the end of the Form The Param will have the value of the selected controls in the Form.
Good Luck.
Hi TTN,
Please ignore my previous reply as I misunderstood for “When we retreat back the string above (Question 1 | Question 2 | Question 4) from the database can K2 parse it into the something like a list so that we can chek the right box.”
It’s very easy to implement with Choice control. Please follow the below steps:
- Drag a choice control.
- For properties of Choice control do the following changes:
- Under Display for Display Type select Check Box and add Delimiter value as ‘|’