0

I have a pdf template that I am trying to populate with SyncFusion and C#. When i load the pdf, my radio button is in PdfLoadedRadioButtonListField

I can set the selected if i use an int based index. This means that if new items are added to the PDF then I have to change my application to determine which index matches the correct radio button item label.

Is it possible to set the selected value based on the label/description of the radio button with SyncFusion?

    PdfLoadedRadioButtonItemCollection radiobuttonFieldCollection = radiobuttonField.Items;
     Radio button field item
    PdfLoadedRadioButtonItem radiobuttonItem1 = radiobuttonFieldCollection[3];
    radiobuttonItem1.Checked = true;
    form.Fields[3].Flatten = true;
user721264
  • 477
  • 2
  • 8
  • 22

1 Answers1

0

I suggest you to use the where clause to find the radiobuttonitem from radiobutton itemcollection. And set the property checked as true for thar item.

 PdfLoadedRadioButtonItem radiobuttonItem1 = item.ToList<PdfLoadedRadioButtonItemCollection >().Where(s => s.Value==lblDesc.Text).ToList()[0];
 radiobuttonItem1.Checked = true;
Sunil Prabakar
  • 442
  • 1
  • 5
  • 19