-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
GridViewSelectEventArgs.xml
141 lines (121 loc) · 9.87 KB
/
GridViewSelectEventArgs.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<Type Name="GridViewSelectEventArgs" FullName="System.Web.UI.WebControls.GridViewSelectEventArgs">
<TypeSignature Language="C#" Value="public class GridViewSelectEventArgs : System.ComponentModel.CancelEventArgs" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit GridViewSelectEventArgs extends System.ComponentModel.CancelEventArgs" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.GridViewSelectEventArgs" />
<TypeSignature Language="VB.NET" Value="Public Class GridViewSelectEventArgs
Inherits CancelEventArgs" />
<TypeSignature Language="F#" Value="type GridViewSelectEventArgs = class
 inherit CancelEventArgs" />
<TypeSignature Language="C++ CLI" Value="public ref class GridViewSelectEventArgs : System::ComponentModel::CancelEventArgs" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.ComponentModel.CancelEventArgs</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides data for the <see cref="E:System.Web.UI.WebControls.GridView.SelectedIndexChanging" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.GridView> control raises the <xref:System.Web.UI.WebControls.GridView.SelectedIndexChanging> event when a Select button (a button with its `CommandName` property set to "Select") is clicked, but before the <xref:System.Web.UI.WebControls.GridView> control handles the select operation. This allows you to provide an event-handling method that performs a custom routine, such as canceling the selection operation, whenever this event occurs.
A <xref:System.Web.UI.WebControls.GridViewSelectEventArgs> object is passed to the event-handling method, which allows you to determine the index of the row selected by the user and to indicate that the selection operation should be canceled. To cancel the selection operation, set the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> property of the <xref:System.Web.UI.WebControls.GridViewSelectEventArgs> object to `true`.
For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/).
For a list of initial property values for an instance of <xref:System.Web.UI.WebControls.GridViewSelectEventArgs>, see the <xref:System.Web.UI.WebControls.GridViewSelectEventArgs.%23ctor%2A> constructor.
## Examples
The following example demonstrates how to use the <xref:System.Web.UI.WebControls.GridViewSelectEventArgs> object passed to the event-handling method to cancel the select operation of a <xref:System.Web.UI.WebControls.GridView> control when the user selects an author with the last name White.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/GridViewSelect/CS/gridviewselectcs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/GridViewSelect/VB/gridviewselectvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.GridView" />
<altmember cref="T:System.Web.UI.WebControls.GridViewSelectEventHandler" />
<altmember cref="E:System.Web.UI.WebControls.GridView.SelectedIndexChanging" />
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public GridViewSelectEventArgs (int newSelectedIndex);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(int32 newSelectedIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.GridViewSelectEventArgs.#ctor(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (newSelectedIndex As Integer)" />
<MemberSignature Language="F#" Value="new System.Web.UI.WebControls.GridViewSelectEventArgs : int -> System.Web.UI.WebControls.GridViewSelectEventArgs" Usage="new System.Web.UI.WebControls.GridViewSelectEventArgs newSelectedIndex" />
<MemberSignature Language="C++ CLI" Value="public:
 GridViewSelectEventArgs(int newSelectedIndex);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="newSelectedIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="newSelectedIndex">The index of the new row to select in the <see cref="T:System.Web.UI.WebControls.GridView" /> control.</param>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.GridViewSelectEventArgs" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.GridViewSelectEventArgs> class.
The following table shows the initial property value for an instance of <xref:System.Web.UI.WebControls.GridViewSelectEventArgs>.
|Property|Initial value|
|--------------|-------------------|
|<xref:System.Web.UI.WebControls.GridViewSelectEventArgs.NewSelectedIndex%2A>|The value of the `newSelectedIndex` parameter.|
> [!NOTE]
> This constructor is used primarily by control developers when raising events.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.GridViewSelectEventArgs.NewSelectedIndex" />
</Docs>
</Member>
<Member MemberName="NewSelectedIndex">
<MemberSignature Language="C#" Value="public int NewSelectedIndex { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 NewSelectedIndex" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.GridViewSelectEventArgs.NewSelectedIndex" />
<MemberSignature Language="VB.NET" Value="Public Property NewSelectedIndex As Integer" />
<MemberSignature Language="F#" Value="member this.NewSelectedIndex : int with get, set" Usage="System.Web.UI.WebControls.GridViewSelectEventArgs.NewSelectedIndex" />
<MemberSignature Language="C++ CLI" Value="public:
 property int NewSelectedIndex { int get(); void set(int value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the index of the new row to select in the <see cref="T:System.Web.UI.WebControls.GridView" /> control.</summary>
<value>The index of the new row to select in the <see cref="T:System.Web.UI.WebControls.GridView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Because the <xref:System.Web.UI.WebControls.GridView.SelectedIndexChanging> event occurs before the <xref:System.Web.UI.WebControls.GridView> control performs the select operation, the <xref:System.Web.UI.WebControls.GridView.SelectedIndex%2A> property of the control cannot be used to determine the index of the new row selected by the user. The <xref:System.Web.UI.WebControls.GridView.SelectedIndex%2A> property still contains the index of the previously selected row. To determine the index of the new row selected by the user, use the <xref:System.Web.UI.WebControls.GridViewSelectEventArgs.NewSelectedIndex%2A> property. You can also use this property to programmatically override the row index selected by the user by setting it to another value.
## Examples
The following example demonstrates how to use the <xref:System.Web.UI.WebControls.GridViewSelectEventArgs.NewSelectedIndex%2A> property to determine the index of the row selected by the user.
:::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/GridViewSelect/CS/gridviewselectcs.aspx" id="Snippet1":::
:::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/GridViewSelect/VB/gridviewselectvb.aspx" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.GridView.SelectedIndex" />
<altmember cref="E:System.Web.UI.WebControls.GridView.SelectedIndexChanging" />
</Docs>
</Member>
</Members>
</Type>