Export (0) Print
Expand All

DataSourceSelectArguments Class

Provides a mechanism that data-bound controls use to request data-related operations from data source controls when data is retrieved. This class cannot be inherited.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

public sealed class DataSourceSelectArguments
public final class DataSourceSelectArguments
public final class DataSourceSelectArguments
Not applicable.

Data-bound controls use the DataSourceSelectArguments class to request that a data source control performs additional data-related operations on a result set, such as sorting the data or returning a specific subset of data. These data-related operations are enumerated by the DataSourceCapabilities enumeration. The following table indicates how the DataSourceSelectArguments class supports these data-related operations.

Data-bound controls explicitly call the PerformSelect method to bind data, which calls the Select method of the data source control they are associated with. In this way, the data-bound control retrieves data from the data source control on demand. Because the Select method accepts a DataSourceSelectArguments parameter, the data-bound control is responsible for creating and managing a DataSourceSelectArguments object and passing it to the Select method when it retrieves data from the data source control.

In some cases, data-bound controls might not need any additional data-related capabilities. In this case, data-bound controls pass an Empty arguments object to the Select method.

For sorted result sets, data-bound controls check a data source view's CanSort property at run time, and add a DataSourceCapabilities.Sort capability using the AddSupportedCapabilities method. As a separate operation, the data-bound control can request a sorted result set from a data source control by setting the SortExpression property on the DataSourceSelectArguments object passed to the Select method.

For paging scenarios, data-bound controls check a data source view's CanPage property at run time, and add a DataSourceCapabilities.Page capability using the AddSupportedCapabilities method. As a separate operation, the data-bound control can request a subset of data from a data source control for paging by setting the StartRowIndex and MaximumRows properties on the DataSourceSelectArguments object passed to the Select method.

To retrieve a total row count for paging scenarios, data-bound controls check a data source view's CanRetrieveTotalRowCount property at run time, and add a DataSourceCapabilities.RetrieveTotalRowCount capability using the AddSupportedCapabilities method. As a separate operation, the data-bound control can request a total row count from a data source control for paging by setting the RetrieveTotalRowCount property on the DataSourceSelectArguments object passed to the Select method. When the Select method returns, the total row count is contained by the TotalRowCount property.

NoteImportant:

If any of the DataSourceSelectArguments properties are set, but the currently bound data source control does not support the requested capability, an InvalidOperationException exception is thrown when the DataSourceSelectArguments.RaiseUnsupportedCapabilitiesError method is called.

System.Object
  System.Web.UI.DataSourceSelectArguments

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft