We have a UserControl that consists of a picture, some TextBlocks and the Syncfusion PropertyGrid. We are trying to print the UserControl but we've run into a problem with the PropertyGrid.
The PropertyGrid doesn't show any items when printed. The PropertyGrid itself shows up with the ButtonPanel and SearchBox, but without the items. We've tried other controls and they do work. After trying some things before printing (eg. Measure, Arrange, RefreshPropertyGrid), we have found that Application.DoEvents does render some of the items in the PropertyGrid. However, the results aren't consistent and reliable.
My question: is there something we can do before printing that renders all the items for the PropertyGrid?
SMSugapriya Mariappan Syncfusion Team June 16, 2015 01:01 PM UTC
Thank you for Contacting Syncfusion support,
We have prepared a sample based on your update and we are unable to reproduce the reported issue "“PropertyGrid doesn't show any items when printed”". In our sample we have implemented printing function for user control in button click and we are able to see the items of Property Grid while printing in OneNote. Kindly download our sample from the following link:
Could you please check our sample and let us know whether we following the correct issue reproducing steps or not? If still you have facing the same issue, kindly get back with us by modifying our sample into issue reproducible sample?, so that it would be very helpful for us to proceed further on this.
Please let us know if you have any other concerns.
PVPim VrolijkJune 16, 2015 03:13 PM UTC
Thank you for the quick response and the sample. I've modified the sample to what we would like to have. We cannot use PrintVisual method because we are working with multiple pages. Instead we work with the PrintDocument which you can see in the sample I've attached. I also added some controls to show that those are rendered correctly. Another difference is that sometimes the UserControls aren't shown to the user before they are printed. So we cannot use it from an existing view but we make an instance before we print it.
In my sample, if you make the UserControl before calling the ShowDialog of the PrintDialog, the PropertyGrid renders correctly. However, if you create it after the ShowDialog, the PropertyGrid stays empty.
If that is the way we are supposed to do it, than we can rewrite and reorder some of our code, but if there is another way to make it render before printing, that would be great.
SMSugapriya Mariappan Syncfusion Team June 18, 2015 10:01 AM UTC
We are sorry about the delay being caused
In our PropertyGrid, we have used animation to update/refresh the items from top to bottom and we have used timer to update this. Due to this reason when we call print dialog before calling UserControl, the control will not be updated. So, the items doesn't get populated while printing. We suggest you to call print dialog after initializing UserControl. This will display the items while printing PropertyGrid.
Please let us know if you have any concerns.