2010-05-20 6 views
1

내 페이지에 radgrid가 있습니다. 내가보기 상태를 끄고 다음 페이지를 클릭 할 때 pageindexchanged 이벤트에서 아무것도 얻지 못할 때. 단순히 빈 페이지. 하지만 뷰 상태를 켜면 다음 페이지에 데이터가 나타납니다. 데이터를 얻을 수있는 방법이 있습니까? 성능 문제로 인해보기 상태로 전환 할 수 없습니다. 아래의 코드를 참조하십시오.RADGrid 관련 문제

.ASPX

<telerik:RadGrid ID="RadGrid1" OnSortCommand="RadGrid1_SortCommand" OnPageIndexChanged="RadGrid1_PageIndexChanged" 
     AllowSorting="True" PageSize="20" ShowGroupPanel="True" AllowPaging="True" AllowMultiRowSelection="True" 
     AllowFilteringByColumn="true" AutoGenerateColumns="false" EnableViewState="false" runat="server" GridLines="None" 
     OnItemUpdated="RadGrid1_ItemUpdated" OnDataBound="RadGrid1_DataBound"> 

aspx.cs

공용 부분 클래스 _Default : System.Web.UI.Page { 보호 보이드를 Page_Load (객체 송신자있는 EventArgs E) { LoadData (); }

private void LoadData() 
{ 
    SqlConnection SqlConn = new SqlConnection("uid=tempuser;password=tempuser;data source=USWASHL10015\\SQLEXPRESS;database=CCOM;"); 
    SqlCommand cmd = new SqlCommand(); 
    cmd.Connection = SqlConn; 
    cmd.CommandType = CommandType.StoredProcedure; 
    cmd.CommandText = "usp_testing"; 
    SqlDataAdapter da = new SqlDataAdapter(cmd); 
    DataSet ds = new DataSet(); 
    da.Fill(ds); 
    RadGrid1.DataSource = ds; 
    RadGrid1.DataBind(); 
    //RadGrid1.ClientSettings.AllowDragToGroup = true; 
} 

protected void RadGrid1_PageIndexChanged(object source, Telerik.Web.UI.GridPageChangedEventArgs e) 
{ 
    //RadGrid1.Rebind(); 
    LoadData(); 
} 

답변