I have a radgrid and since I have custom buttons, I am using the CommandItemTemplate. But it throws "Cannot set property 'control' of undefined" error! When I comment out this._RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; It does not throw the error and ofcourse the CommandItemTemplate is also not visible.
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this._RadLoadingPanel.ID = "_RadLoadingPanel";
this._RadLoadingPanel.Transparency = 30;
this._RadLoadingPanel.Skin = "WebBlue";
this._RadLoadingPanel.BackgroundPosition = AjaxLoadingPanelBackgroundPosition.Center;
this._RadGrid1.Skin = "WebBlue";
this._RadGrid1.Width = Unit.Percentage(100);
this._RadGrid1.GridLines = GridLines.None;
this._RadGrid1.PageSize = 20;
this._RadGrid1.AllowPaging = true;
this._RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
this._RadGrid1.AllowSorting = true;
this._RadGrid1.AllowFilteringByColumn = false;
this._RadGrid1.AllowAutomaticUpdates = false;
this._RadGrid1.AutoGenerateColumns = false;
this._RadGrid1.EnableLinqExpressions = false;
this._RadGrid1.MasterTableView.NoMasterRecordsText = "No Deals found";
this._RadGrid1.ShowGroupPanel = false;
this._RadGrid1.ShowStatusBar = true;
this._RadGrid1.GroupingEnabled = false;
this._RadGrid1.ClientSettings.Selecting.AllowRowSelect = true;
this._RadGrid1.ClientSettings.EnableRowHoverStyle = true;
this._RadGrid1.ClientSettings.EnablePostBackOnRowClick = true;
this._RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
//add buttons
this._RadGrid1.MasterTableView.CommandItemTemplate = new DealTemplate(this._RadGrid1, "State");
this._RadGrid1.MasterTableView.DataKeyNames = "PriceID";
this._RadGrid1.MasterTableView.ClientDataKeyNames = "Status";
this._RadGrid1.MasterTableView.EnableHeaderContextMenu = true;
this._RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true;
this._RadGrid1.ClientSettings.ClientEvents.OnRowSelected = "OnRowSelected";
this._RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
this._RadGrid1.ItemDataBound += RadGrid1_ItemDataBound;
#region Columns
}