Skip to content

Commit 9e2d87d

Browse files
committed
2 parents 82ee407 + 4c2dfd6 commit 9e2d87d

File tree

9 files changed

+349
-98
lines changed

9 files changed

+349
-98
lines changed

controls/gridview/columns/column-types/gridviewselectcolumn.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,27 @@ Me.RadGridView1.ShowSelectColumn = True
4444

4545
If the *MultiSelect* property is enabled, users can make a [multiple selection in RadGridView]({%slug winforms/gridview/selection/multiple-selection%}). When using the selection UI through GridViewSelectColumn, the users will be able to select multiple rows by simply checking a checkbox. If *MultiSelect* property is *false*, the users can select only a single row/cell.
4646

47+
#### Row selection via checkboxes only
48+
49+
In some cases, the user may need to use multiple row selection through the **GridViewSelectColumn** only. The **UseCheckboxRowSelectionOnly** property defines whether the user can select rows only via the checkboxes. When **UseCheckboxRowSelectionOnly** is set to *true*, the selection only via checkboxes is allowed. Thus, if you click with the mouse over different rows they will not get selected, until you check the corresponding checkbox from the **GridViewSelectColumn**.
50+
51+
{{source=..\SamplesCS\GridView\Columns\GridViewSelectColumn.cs region=CheckboxRowSelection}}
52+
{{source=..\SamplesVB\GridView\Columns\GridViewSelectColumn.vb region=CheckboxRowSelection}}
53+
54+
````C#
55+
this.radGridView1.MasterTemplate.UseCheckboxRowSelectionOnly = true;
56+
57+
````
58+
````VB.NET
59+
Me.RadGridView1.MasterTemplate.UseCheckboxRowSelectionOnly = True
60+
61+
````
62+
63+
{{endregion}}
64+
65+
66+
>note The **UseCheckboxRowSelectionOnly** will only be considered if **ShowSelectColumn** is set to *true*.
67+
4768
#### Hierarchy mode
4869

4970
**GridViewSelectColumn** is also supported when RadGridView is bound to hierarchical data and child templates in the hierarchy view are shown. In case you would like to enable this setting in a hierarchy, it is necessary to set **ShowSelectColumn** to the respective child template:
Lines changed: 124 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
---
2-
title: Annotations
3-
page_title: Annotations - WinForms PdfViewer Control
4-
description: WinForms PdfViewer supports Link annotations, which means that if you open a PDF file that includes hyperlinks to absolute URIs, you can click them and have a window open, navigated to the respective address.
5-
slug: winforms/pdfviewer/annotations
6-
tags: annotations
7-
published: True
8-
position: 0
9-
---
10-
11-
# Annotations
12-
__RadPdfViewer__ supports link annotations, which means that if you open a PDF file that includes hyperlinks to absolute URIs, you can click them and have a window open, navigated to the respective address. In addition, if there are links pointing to bookmarks in the same document, the view port will be scrolled to the destination specified in the link.
13-
14-
The current API includes the following members, which allow customization of the default behavior or implementing custom logic:
15-
16-
* __AnnotationClicked__ event of __RadPdfViewer__: This event is fired when you click on an annotation such as a hyperlink. It comes handy when you want to detect or even cancel the opening of a web page. The __AnnotationEventArgs__ contain the Annotation as property and the Link itself has information of its Action, i.e. if it is a UriAction. Handling the event in the following manner will not only show the Uri of each clicked link as the text of a MessageBox, but will also cancel the default behavior.
17-
18-
#### AnnotationClicked Event Handler
19-
20-
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=AnnotationClicked}}
21-
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=AnnotationClicked}}
22-
1+
---
2+
title: Annotations
3+
page_title: Annotations - WinForms PdfViewer Control
4+
description: WinForms PdfViewer supports Link annotations, which means that if you open a PDF file that includes hyperlinks to absolute URIs, you can click them and have a window open, navigate to the respective address.
5+
slug: winforms/pdfviewer/annotations
6+
tags: annotations
7+
published: True
8+
position: 0
9+
---
10+
11+
# Annotations
12+
13+
__RadPdfViewer__ supports link annotations, which means that if you open a PDF file that includes hyperlinks to absolute URIs, you can click them and have a window open, and navigate to the respective address. In addition, if there are links pointing to bookmarks in the same document, the view port will be scrolled to the destination specified in the link.
14+
15+
The current API includes the following members, which allow customization of the default behavior or implementation of custom logic:
16+
17+
* __AnnotationClicked__ event of __RadPdfViewer__: This event is fired when you click on an annotation such as a hyperlink. It comes in handy when you want to detect or even cancel the opening of a web page. The __AnnotationEventArgs__ contains the Annotation as property and the Link itself has information of its Action, i.e. if it is a UriAction. Handling the event in the following manner will not only show the Uri of each clicked link as the text of a MessageBox but will also cancel the default behavior.
18+
19+
#### AnnotationClicked Event Handler
20+
21+
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=AnnotationClicked}}
22+
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=AnnotationClicked}}
23+
2324
````C#
2425

2526
private void radPdfViewer1_AnnotationClicked(object sender, Telerik.Windows.Documents.Fixed.Model.Annotations.EventArgs.AnnotationEventArgs e)
@@ -37,8 +38,8 @@ private void radPdfViewer1_AnnotationClicked(object sender, Telerik.Windows.Docu
3738
MessageBox.Show(a.Uri.ToString());
3839
e.Handled = true;
3940
}
40-
41-
````
41+
42+
````
4243
````VB.NET
4344
Private Sub radPdfViewer1_AnnotationClicked(sender As Object, e As Telerik.Windows.Documents.Fixed.Model.Annotations.EventArgs.AnnotationEventArgs)
4445
Dim l As Telerik.Windows.Documents.Fixed.Model.Annotations.Link = TryCast(e.Annotation, Telerik.Windows.Documents.Fixed.Model.Annotations.Link)
@@ -52,18 +53,64 @@ Private Sub radPdfViewer1_AnnotationClicked(sender As Object, e As Telerik.Windo
5253
MessageBox.Show(a.Uri.ToString())
5354
e.Handled = True
5455
End Sub
55-
56-
````
57-
58-
{{endregion}}
59-
60-
* __Annotations__ property of __RadFixedDocument__ – A collection which returns all annotations in the document. For example you can retrieve all links using the following code:
61-
62-
#### Get Annotation Links
63-
64-
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=GetAllLinks}}
65-
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=GetAllLinks}}
66-
56+
57+
````
58+
59+
{{endregion}}
60+
61+
* __HyperlinkClicked__ event of RadPdfViewer: This event is similar to AnnotationClicked, but it is raised only when you click on the hyperlink type annotations. It allows you to cancel the navigation to the associated URI or to modify the click action. The HyperlinkClickedEventArgs gives access to the URL, which can be manually checked if it is trusted. With the 2024 Q3 (2024.3.924), the default navigation behavior of the hyperlinks is to automatically open only valid and trusted addresses. If needed, the navigation can be canceled by either setting the __Handled__ property of the event args to _true_ or the __IsTrustedUrl__ property to _false_. Below is an example of using this event to prompt that the clicked hyperlink might be unsafe and provide the opportunity to cancel the navigation process upon receiving the end user confirmation:
62+
63+
#### HyperlinkClicked Event Handler
64+
65+
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=HyperlinkClicked}}
66+
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=HyperlinkClicked}}
67+
68+
````C#
69+
private void RadPdfViewer1_HyperlinkClicked(object sender, Telerik.WinControls.Hyperlinks.HyperlinkClickedEventArgs e)
70+
{
71+
var link = e.URL;
72+
if (link.EndsWith("exe"))
73+
{
74+
e.Handled = true; MessageBoxResult Result = System.Windows.MessageBox.Show("You are about to open an executable file. Do you want to proceed", "Possible unsafe link", MessageBoxButton.YesNo, MessageBoxImage.Question);
75+
if (Result == MessageBoxResult.Yes)
76+
{
77+
Process.Start(new ProcessStartInfo()
78+
{
79+
FileName = link,
80+
UseShellExecute = true
81+
});
82+
}
83+
}
84+
}
85+
86+
````
87+
````VB.NET
88+
Private Sub RadPdfViewer1_HyperlinkClicked(sender As Object, e As HyperlinkClickedEventArgs)
89+
Dim link = e.URL
90+
If link.EndsWith("exe") Then
91+
e.Handled = True
92+
Dim Result As MessageBoxResult = System.Windows.MessageBox.Show("You are about to open an executable file. Do you want to proceed", "Possible unsafe link", MessageBoxButton.YesNo, MessageBoxImage.Question)
93+
If Result = MessageBoxResult.Yes Then
94+
Process.Start(New ProcessStartInfo() With {
95+
.FileName = link,
96+
.UseShellExecute = True
97+
})
98+
End If
99+
End If
100+
End Sub
101+
102+
````
103+
104+
{{endregion}}
105+
106+
107+
* __Annotations__ property of __RadFixedDocument__ – A collection which returns all annotations in the document. For example, you can retrieve all links using the following code:
108+
109+
#### Get Annotation Links
110+
111+
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=GetAllLinks}}
112+
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=GetAllLinks}}
113+
67114
````C#
68115

69116
private IEnumerable<Telerik.Windows.Documents.Fixed.Model.Annotations.Link> GetAllLinks(Telerik.Windows.Documents.Fixed.Model.RadFixedDocument document)
@@ -77,8 +124,8 @@ private IEnumerable<Telerik.Windows.Documents.Fixed.Model.Annotations.Link> GetA
77124
}
78125
}
79126
}
80-
81-
````
127+
128+
````
82129
````VB.NET
83130
Private Iterator Function GetAllLinks(document As Telerik.Windows.Documents.Fixed.Model.RadFixedDocument) As IEnumerable(Of Telerik.Windows.Documents.Fixed.Model.Annotations.Link)
84131
For Each a As Telerik.Windows.Documents.Fixed.Model.Annotations.Annotation In document.Annotations
@@ -88,18 +135,18 @@ Private Iterator Function GetAllLinks(document As Telerik.Windows.Documents.Fixe
88135
End If
89136
Next
90137
End Function
91-
92-
````
93-
94-
{{endregion}}
95-
96-
The bookmarks in terms of “docx bookmarks” are not explicitly saved in PDF files. They are persisted only if there are Link annotations to them, so you can use the snippet below to retrieve all destinations that have links to them:
97-
98-
#### Get Annotation Bookmarks
99-
100-
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=Bookmarks}}
101-
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=Bookmarks}}
102-
138+
139+
````
140+
141+
{{endregion}}
142+
143+
The bookmarks in terms of “docx bookmarks” are not explicitly saved in PDF files. They are persisted only if there are Link annotations to them, so you can use the snippet below to retrieve all destinations that have links to them:
144+
145+
#### Get Annotation Bookmarks
146+
147+
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=Bookmarks}}
148+
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=Bookmarks}}
149+
103150
````C#
104151

105152
private IEnumerable<Telerik.Windows.Documents.Fixed.Model.Navigation.Destination> GetAllBookmarks(Telerik.Windows.Documents.Fixed.Model.RadFixedDocument document)
@@ -113,8 +160,8 @@ private IEnumerable<Telerik.Windows.Documents.Fixed.Model.Navigation.Destination
113160
}
114161
}
115162
}
116-
117-
````
163+
164+
````
118165
````VB.NET
119166
Private Iterator Function GetAllBookmarks(document As Telerik.Windows.Documents.Fixed.Model.RadFixedDocument) As IEnumerable(Of Telerik.Windows.Documents.Fixed.Model.Navigation.Destination)
120167
For Each a As Telerik.Windows.Documents.Fixed.Model.Annotations.Annotation In document.Annotations
@@ -124,38 +171,38 @@ Private Iterator Function GetAllBookmarks(document As Telerik.Windows.Documents.
124171
End If
125172
Next
126173
End Function
127-
128-
````
129-
130-
{{endregion}}
131-
132-
In this way it would be possible to create some UI that contains all bookmarks. Then, you could implement the same action as the one being executed when a hyperlink is clicked, i.e. scroll the document to the specific place in the document where the destination of the link is placed. The following code can be used for this purpose – navigating to a specific destination:
133-
134-
#### Navigate to Destination
135-
136-
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=GoToDestination}}
137-
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=GoToDestination}}
138-
174+
175+
````
176+
177+
{{endregion}}
178+
179+
In this way, creating some UI containing all bookmarks would be possible. Then, you could implement the same action as the one being executed when a hyperlink is clicked, i.e. scroll the document to the specific place in the document where the destination of the link is placed. The following code can be used for this purpose – navigating to a specific destination:
180+
181+
#### Navigate to Destination
182+
183+
{{source=..\SamplesCS\PdfViewer\PdfAnnotations.cs region=GoToDestination}}
184+
{{source=..\SamplesVB\PdfViewer\PdfAnnotations.vb region=GoToDestination}}
185+
139186
````C#
140187

141188
private void GoToDestination(Telerik.Windows.Documents.Fixed.Model.Navigation.Destination destination)
142189
{
143190
this.radPdfViewer1.PdfViewerElement.GoToDestination(destination);
144191
}
145-
146-
````
192+
193+
````
147194
````VB.NET
148195
Private Sub GoToDestination(destination As Telerik.Windows.Documents.Fixed.Model.Navigation.Destination)
149196
Me.RadPdfViewer1.PdfViewerElement.GoToDestination(destination)
150197
End Sub
151-
152-
````
153-
154-
{{endregion}}
155-
156-
# See Also
157-
158-
* [Getting Started]({%slug winforms/pdfviewer/getting-started%})
159-
* [Logical Structure]({%slug winforms/pdfviewer/structure/logical-structure%})
160-
* [Visual Structure]({%slug winforms/pdfviewer/structure/visual-structure%})
161-
* [Properties, Methods and Events]({%slug winforms/pdfviewer/properties-methods-and-events%})
198+
199+
````
200+
201+
{{endregion}}
202+
203+
## See Also
204+
205+
* [Getting Started]({%slug winforms/pdfviewer/getting-started%})
206+
* [Logical Structure]({%slug winforms/pdfviewer/structure/logical-structure%})
207+
* [Visual Structure]({%slug winforms/pdfviewer/structure/visual-structure%})
208+
* [Properties, Methods and Events]({%slug winforms/pdfviewer/properties-methods-and-events%})

controls/richtexteditor/events.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,15 @@ The __RadRichTextEditor__ control raises the following specific events:
8787
8888
* An __EventArgs__ object.
8989

90-
* __HyperlinkClicked__ - occurs when the current page has changed. The event handler receives two arguments:
91-
92-
* The sender argument contains the __RadRichTextEditor__. This argument is of type object, but can be cast to the __RadRichTextEditor__ type.
93-
94-
* A __HyperlinkClickedEventArgs__ object. This argument allows you to access the URL and the target of the hyperlink.
90+
* __HyperlinkClicked__ - Occurs when the users clicks on a hyperlink in the current document. The event allows you to either cancel or replace the navigation logic. HyperlinkClicked event can be used as a confirmation from the end-user whether to proceed or not with opening a hyperlink due to security reasons. The event handler receives two arguments:
91+
92+
* The sender argument contains the __Span__ containing the hyperlink's content. This argument is of type object, but can be cast to the __Span__ type.
93+
94+
* A __HyperlinkClickedEventArgs__ object. This argument allows you to access the following properties:
95+
- __Handled__: Get or set a value indicating whether the event is handled.
96+
- __HyperlinkTarget__: Gets the target hyperlink.
97+
- __URL__: Gets the URL of the hyperlink.
98+
- __IsTrustedUrl__: Gets a value tha indicates if the URL passes the validation. If the URL is not trusted, the hyperlink will not be opened. Set this property to true to open the hyperlink. For more information see [Hyperlink]({%slug winforms/richtexteditor-/features/hyperlink%}) article.
9599
96100
* __IsReadOnlyChanged__ - occurs when __IsReadOnly__ value has changed. The event handler receives two arguments:
97101

0 commit comments

Comments
 (0)