-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
DetailsViewModeEventHandler.xml
55 lines (46 loc) · 4.33 KB
/
DetailsViewModeEventHandler.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<Type Name="DetailsViewModeEventHandler" FullName="System.Web.UI.WebControls.DetailsViewModeEventHandler">
<TypeSignature Language="C#" Value="public delegate void DetailsViewModeEventHandler(object sender, DetailsViewModeEventArgs e);" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed DetailsViewModeEventHandler extends System.MulticastDelegate" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.DetailsViewModeEventHandler" />
<TypeSignature Language="VB.NET" Value="Public Delegate Sub DetailsViewModeEventHandler(sender As Object, e As DetailsViewModeEventArgs)" />
<TypeSignature Language="F#" Value="type DetailsViewModeEventHandler = delegate of obj * DetailsViewModeEventArgs -> unit" />
<TypeSignature Language="C++ CLI" Value="public delegate void DetailsViewModeEventHandler(System::Object ^ sender, DetailsViewModeEventArgs ^ e);" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Delegate</BaseTypeName>
</Base>
<Parameters>
<Parameter Name="sender" Type="System.Object" />
<Parameter Name="e" Type="System.Web.UI.WebControls.DetailsViewModeEventArgs" />
</Parameters>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Docs>
<param name="sender">The source of the event.</param>
<param name="e">A <see cref="T:System.Web.UI.WebControls.DetailsViewModeEventArgs" /> that contains the event data.</param>
<summary>Represents the method that handles the <see cref="E:System.Web.UI.WebControls.DetailsView.ModeChanging" /> event of a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.ModeChanging> event is raised when a <xref:System.Web.UI.WebControls.DetailsView> control attempts to change between edit, insert, and read-only mode, but before the mode actually changes. This allows you to provide an event handler that performs a custom routine, such as configuring the <xref:System.Web.UI.WebControls.DetailsView> control for a specific mode or canceling the mode change, whenever this event occurs.
When you create a <xref:System.Web.UI.WebControls.DetailsViewModeEventHandler> delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/).
## Examples
The following code example demonstrates how to programmatically add a <xref:System.Web.UI.WebControls.DetailsViewModeEventHandler> delegate to the <xref:System.Web.UI.WebControls.DetailsView.ModeChanging> event of a <xref:System.Web.UI.WebControls.DetailsView> control.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DetailsViewModeEventHandlerInline/CS/detailsviewmodeeventhandlerinlinecs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewModeEventHandlerInline/VB/detailsviewmodeeventhandlerinlinevb.aspx" id="Snippet1":::
The following code example demonstrates how to declaratively add a <xref:System.Web.UI.WebControls.DetailsViewModeEventHandler> delegate to the <xref:System.Web.UI.WebControls.DetailsView.ModeChanging> event of a <xref:System.Web.UI.WebControls.DetailsView> control.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DetailsViewModeEventHandler/CS/detailsviewmodeeventhandlercs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewModeEventHandler/VB/detailsviewmodeeventhandlervb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.DetailsView" />
<altmember cref="T:System.Web.UI.WebControls.DetailsViewModeEventArgs" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ModeChanging" />
<altmember cref="M:System.Web.UI.WebControls.DetailsView.OnModeChanging(System.Web.UI.WebControls.DetailsViewModeEventArgs)" />
</Docs>
</Type>