GridView.EnableSortingAndPagingCallbacks 속성

정의

정렬 및 페이징 작업에 클라이언트측 콜백을 사용할지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 virtual property bool EnableSortingAndPagingCallbacks { bool get(); void set(bool value); };
public virtual bool EnableSortingAndPagingCallbacks { get; set; }
member this.EnableSortingAndPagingCallbacks : bool with get, set
Public Overridable Property EnableSortingAndPagingCallbacks As Boolean

속성 값

Boolean

정렬 및 페이징 작업에 클라이언트측 콜백을 사용하려면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예외

Columns 컬렉션에 콜백을 지원하지 않는 TemplateField 등의 열이 포함된 경우

예제

다음 예제에서는 정렬 및 페이징 작업에 대 한 클라이언트 쪽 콜백을 사용 하도록 속성을 사용 EnableSortingAndPagingCallbacks 하는 방법을 보여 줍니다.


<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>GridView EnableSortingAndPagingCallbacks Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView EnableSortingAndPagingCallbacks Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true"
        allowsorting="true"
        enablesortingandpagingcallbacks="true"        
        runat="server">
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects  -->
      <!-- to the Northwind sample database. Use an ASP.NET     -->
      <!-- expression to retrieve the connection string value   -->
      <!-- from the Web.config file.                            -->
      <asp:sqldatasource id="CustomersSource"
        selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
        runat="server"/>
        
    </form>
  </body>
</html>

<%@ Page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>GridView EnableSortingAndPagingCallbacks Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView EnableSortingAndPagingCallbacks Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true"
        allowsorting="true"
        enablesortingandpagingcallbacks="true"        
        runat="server">
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects  -->
      <!-- to the Northwind sample database. Use an ASP.NET     -->
      <!-- expression to retrieve the connection string value   -->
      <!-- from the Web.config file.                            -->
      <asp:sqldatasource id="CustomersSource"
        selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
        runat="server"/>
        
    </form>
  </body>
</html>

설명

기본적으로 정렬 또는 페이징 작업이 수행되면 컨트롤이 GridView 서버에 다시 게시되어 작업을 수행합니다. 속성이 EnableSortingAndPagingCallbacks 설정 true되면 정렬 및 페이징 작업을 수행하기 위해 클라이언트에서 서비스가 호출되므로 서버에 다시 게시할 필요가 없습니다.

참고

모든 브라우저에서 이 기능을 지원하지는 않습니다. 브라우저에서 이 기능을 지원하는지 여부를 확인하려면 이 속성을 사용합니다 SupportsCallback .

컬렉션의 모든 열은 Columns 이 기능이 작동하려면 콜백을 지원해야 합니다. 컬렉션에 Columns 콜백(예: TemplateFieldNotSupportedException 콜백)을 지원하지 않는 열이 포함되어 있으면 예외가 발생합니다.

적용 대상

추가 정보