0

I have a list A with field SAP (radiobutton datatype). It has 3 values SAP-FSL, SAP NXP and both. I need to display these 3 values in webpart as radiobutton provided in image. It will be dynamic, in future if we want to add new radio control in webpart we just want to add new value in fields SAP. How to achieve this. Please help with c#. Thanks. List value in webpart

0
SPFieldChoice field = (SPFieldChoice)spList.Fields[fieldName];

List<string> fieldList = new List<string>();

foreach (string str in field.Choices)
{
    fieldList.Add(str);
}

where spList is SPList object.

fieldList contains the choice fields value. Using these values, you can bind your radio-button list.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.