Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

LinqDataSourceSelectEventArgs Class

Provides data for the Selecting event.

System.Object
  System.EventArgs
    System.ComponentModel.CancelEventArgs
      System.Web.UI.WebControls.LinqDataSourceSelectEventArgs

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
type LinqDataSourceSelectEventArgs =  
    class 
        inherit CancelEventArgs 
    end

The LinqDataSourceSelectEventArgs type exposes the following members.

  NameDescription
Public methodLinqDataSourceSelectEventArgsInitializes a new instance of the LinqDataSourceSelectEventArgs class.
Top
  NameDescription
Public propertyArgumentsGets values that determine how the data is returned.
Public propertyCancelGets or sets a value indicating whether the event should be canceled. (Inherited from CancelEventArgs.)
Public propertyGroupByParametersGets the collection of parameters that is used to create the GroupBy clause.
Public propertyOrderByParametersGets the collection of parameters that is used to create the OrderBy clause.
Public propertyOrderGroupsByParametersGets the collection of parameters that are used to create the clause that specifies how grouped data is sorted.
Public propertyResultGets or sets the data object that is used in the data query.
Public propertySelectParametersGets the collection of parameters that is used to create the Select clause.
Public propertyWhereParametersGets the collection of parameters that is used to create the Where clause.
Top
  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The LinqDataSourceSelectEventArgs object is passed to event handlers for the Selecting event of the LinqDataSource control. You use the LinqDataSourceSelectEventArgs object to manually specify what data is returned, and how the data is sorted and paged when it is returned. You can programmatically add or remove parameters to the GroupBy, OrderBy, OrderGroupsBy, Select, and Where clauses by using the GroupByParameters, OrderByParameters, OrderGroupsByParameters, SelectParameters, and WhereParameters collections.

The Result property enables you to change the data object that is used for the query. If you assign an object to the Result property, that object will be used for queries instead of the object specified in the TableName property of the LinqDataSource control.

The Arguments property enables you to customize how returned data is sorted and paged. The data-bound control passes sorting and paging properties through the Arguments property. If you have to manually handle sorting or paging, set the AutoSort property or AutoPage property of the LinqDataSource control to false. You can then perform the customized query for sorting or paging in a handler for the Selecting event.

If the RetrieveTotalRowCount property is set to true, you must return a value for the TotalRowCount property.

The following example shows how to set the Result property to the result of a search made by using language-integrated query (LINQ).

No code example is currently available or this language may not be supported.

The following example shows how to set the Result property to an array of string values that is defined in the Web page.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.