Я хочу создать костюм Gridview
. Я нашел очень хороший открытый исходный код, но проблема в том, что он используетDataGrid
, и когда я изменяю унаследованный класс наGridView
, Я получаю следующую ошибку
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);
}
как вы видите в коде, я просто меняю DataGrid
на GridView
. У обоих OnItemDataBound, так в чем проблема?
Спасибо
Аргументы события имеют тип
DataGridItemEventArgs
. Необходимо изменить тип параметра на новый параметр базового класса.