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

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

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

foreach (string str in field.Choices)

where spList is SPList object.

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

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.