We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Using PdfLoadedComboBoxField where .Ietms.Count = 0 but the combofield has values

Thread ID:

Created:

Updated:

Platform:

Replies:

118285 Feb 19,2015 01:51 PM Feb 24,2015 07:21 AM Windows Forms 5
loading
Tags: PDF
jb
Asked On February 19, 2015 01:51 PM

Am trying to use a customer PDF with this code

 PdfLoadedComboBoxField comboField = form.Fields[4] as PdfLoadedComboBoxField;
                PdfLoadedComboBoxItemCollection comboCollection = comboField.Items;
                PdfLoadedComboBoxItem item = comboCollection[0]; //This throws exception as .Ietms.Count = 0

However
comboField .Values[0] has  a value. 

How can I prefill the comboboxfield?


jb
Replied On February 19, 2015 01:57 PM

Am trying to use a customer PDF with this code

 PdfLoadedComboBoxField comboField = form.Fields[4] as PdfLoadedComboBoxField;
                PdfLoadedComboBoxItemCollection comboCollection = comboField.Items;
                PdfLoadedComboBoxItem item = comboCollection[0]; //This throws exception as .Ietms.Count = 0

However
comboField .Values[0] has  a value. 

How can I prefill the comboboxfield?


attaching sample file

Attachment: Test_123ed2d5.zip

jb
Replied On February 19, 2015 02:23 PM

Am trying to use a customer PDF with this code

 PdfLoadedComboBoxField comboField = form.Fields[4] as PdfLoadedComboBoxField;
                PdfLoadedComboBoxItemCollection comboCollection = comboField.Items;
                PdfLoadedComboBoxItem item = comboCollection[0]; //This throws exception as .Ietms.Count = 0

However
comboField .Values[0] has  a value. 

How can I prefill the comboboxfield?


attaching sample file

Attachment: Test_123ed2d5.zip

If possible can you provide code that would populate some combo box field and leave some empty and save the pdf? currently if i save the pdf with no entry in combobox field, i get a white space where combo box is instead of a rectangle

jb
Replied On February 19, 2015 03:23 PM

Am trying to use a customer PDF with this code

 PdfLoadedComboBoxField comboField = form.Fields[4] as PdfLoadedComboBoxField;
                PdfLoadedComboBoxItemCollection comboCollection = comboField.Items;
                PdfLoadedComboBoxItem item = comboCollection[0]; //This throws exception as .Ietms.Count = 0

However
comboField .Values[0] has  a value. 

How can I prefill the comboboxfield?


attaching sample file

Attachment: Test_123ed2d5.zip

If possible can you provide code that would populate some combo box field and leave some empty and save the pdf? currently if i save the pdf with no entry in combobox field, i get a white space where combo box is instead of a rectangle

This is my code and figured out where the issue is

PdfLoadedDocument page1Document = new PdfLoadedDocument(path to my pdf file);
PdfDocument doc = new PdfDocument();
PdfLoadedForm form = page1Document.Form;
 (form.Fields[2] as PdfLoadedTextBoxField).Text = "ABC";
(form.Fields[4] as PdfLoadedComboBoxField).SelectedIndex = new string[] { "HELLO" };

 form.ReadOnly = true;

  form.Flatten = true;

  //Append the loaded document
  //AT THIS POINT THE COMBO BOX IS LOADED CORRECTLY IN page1Document             
  doc.Append(page1Document);
/  //AT THIS POINT THE COMBO BOX HAS NO DATA IN doc
 doc.Save(path);
 doc.Close();




Abirami Selvan [Syncfusion]
Replied On February 21, 2015 12:33 AM

Hi Jb,

Thank you for using Syncfusion Products.


As we have analyzed your code , We are able to reproduce the issue with “PdfComboBox is not displayed  when appending the loadeddocument  “and suspect this to be a defect. We will update you with further details on 24th  Feb 2015.

Thanks,
Abirami


Abirami Selvan [Syncfusion]
Replied On February 24, 2015 07:21 AM

Hi Jb ,

We were able to reproduce the problem and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Thanks ,
Abirami.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;