2016-12-26 49 views
0

我想製作服裝Gridview。我覺得很不錯的開源之一,但問題是,它使用DataGrid當我更改繼承類GridView,我得到以下錯誤如何覆蓋GridView的OnItemDataBound方法?

AADGridView.OnItemDataBound(DataGridItemEventArgs E):沒有合適的方法找到覆蓋

我倍率在此:

//public class AADGridView : DataGrid, IPostBackEventHandler 
     public class AADGridView : GridView, IPostBackEventHandler 
     { 

      /// <summary> 
      /// Gets or sets a value that indicates whether the auto filter is displayed in the AADGrid.AADGridControl. 
      /// </summary> 
      [Bindable(true), Category("Appearance"), Description("Whether to show the control's auto filter."), DefaultValue(true),] 


      /// <summary> 
      /// Override the DataGrid constructor. 
      /// </summary> 
      public AADGridView() : base() 
      { 
       // create the ArrayList to contain the DropDownList controls and the SortedList objects added to the header items; 
       //list = new ArrayList(); 
       sort = new ArrayList(); 
       filter = true; 
      } 

      /// <summary> 
      /// Override the OnItemDataBound event. 
      /// </summary> 
      /// <param name="e"></param> 
      override protected void OnItemDataBound(DataGridItemEventArgs e) 
      { 
       //Some Code 
       base.OnItemDataBound(e); 
      } 

,你在代碼中看到的,我舉st改爲DataGridGridView。他們都有OnItemDataBound,那麼問題是什麼? 謝謝

回答

0

事件參數的類型爲DataGridItemEventArgs。您必須將參數類型更改爲新的基類的參數。

+0

。我該怎麼做?請給我一些 @ Sefe – AminAmiriDarban