This is a migrated thread and some comments may be shown as answers.

Force Leaving Interactive Form Field

1 Answer 63 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Brandon
Top achievements
Rank 1
Brandon asked on 19 Jun 2018, 08:06 PM

Hello,

We are playing with the interactive form pdf and when you are in the field editing the text and then we go to save the document the field has not yet been updated with the new value.  Is there a way to force them out of the field editing and update the text of the field when they click the save button?

Thanks,

Brandon

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi
Telerik team
answered on 22 Jun 2018, 04:13 PM
Hi Brandon,

Thank you for reporting us this issue.

We have logged a bug report in our feedback portal where you can subscribe to be notified for any status updates. In appreciation of your report, I have increased your Telerik points.

As a possible workaround, you can raise a MouseLeftButtonDown event on the RadPdfViewer and after this execute the SaveAsCommand. For example:
private void SaveButton_Click(object sender, RoutedEventArgs e)
{
    MouseButtonEventArgs mouseEventArgs = new MouseButtonEventArgs(Mouse.PrimaryDevice, 0, MouseButton.Left)
    {
        RoutedEvent = FrameworkElement.MouseLeftButtonDownEvent
    };
 
    ((FrameworkElement)this.pdfViewer.FixedDocumentPresenter).RaiseEvent(mouseEventArgs);
    this.pdfViewer.CommandDescriptors.SaveAsCommandDescriptor.Command.Execute(null);
}

Instead of attaching on the Click event of the SaveButton, you can also create custom command with custom command descriptor.

I hope this helps. 

Regards,
Georgi
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
PDFViewer
Asked by
Brandon
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or