To reproducce:
- Try to search with the following code:
SearchResult searchResult = this.radPdfViewer1.Document.TextSearch.Find("domain model");
if (searchResult.Result != null)
{
this.radPdfViewer1.Select(searchResult);
}
Workaround:
- Use reflection:
PropertyInfo property = typeof(Telerik.Windows.Documents.Fixed.Model.RadFixedDocument).GetProperty("TextSearch", BindingFlags.Instance | BindingFlags.NonPublic);
Type propType = property.PropertyType;
MethodInfo findMethod = propType.GetMethod("Find", BindingFlags.Instance | BindingFlags.Public);
SearchResult searchResult = (SearchResult)findMethod.Invoke(property.GetValue(this.radPdfViewer1.Document, null),
new object[] { "EditorRequired", TextSearchOptions.Default });
if (searchResult.Result != null)
{
this.radPdfViewer1.Select(searchResult);
}