I'm creating a dinamic grid but having proble adding Ajax to it, also I need to be able to have multi select field so I was thinking about DropDown with checkbox.
I add the HTMLColumn bud it didn't work neither.
here it is.
private
void DefineGridStructure()
{
RadGrid1.ID =
"RadGrid1";
RadGrid1.Width =
Unit.Percentage(98);
RadGrid1.AllowPaging =
true;
RadGrid1.AllowSorting =
true;
RadGrid1.PagerStyle.Mode =
GridPagerMode.NumericPages;
RadGrid1.AutoGenerateColumns =
false;
//RadGrid1.EnableAJAX = true;
RadGrid1.GridLines =
GridLines.None;
RadGrid1.ShowStatusBar =
true;
RadGrid1.AllowAutomaticDeletes =
true;
RadGrid1.AllowAutomaticInserts =
true;
RadGrid1.AllowAutomaticUpdates =
true;
GridEditCommandColumn editcommandColumn;
editcommandColumn =
new GridEditCommandColumn();
RadGrid1.MasterTableView.Columns.Add(editcommandColumn);
editcommandColumn.UniqueName =
"ThiseditcommandColumn";
editcommandColumn.ButtonType =
GridButtonColumnType.ImageButton;
editcommandColumn.EditImageUrl =
"~/Images/grid/edit.gif";
editcommandColumn.HeaderText = edit;
RadGrid1.MasterTableView.DataKeyNames =
new string[] {"LibraryID", "PortalID"};
RadGrid1.MasterTableView.AutoGenerateColumns =
false;
RadGrid1.PageIndexChanged +=
new Telerik.Web.UI.GridPageChangedEventHandler(this.RadGrid1_PageIndexChanged);
RadGrid1.NeedDataSource +=
new Telerik.Web.UI.GridNeedDataSourceEventHandler(this.RadGrid1_NeedDataSource);
RadGrid1.PreRender +=
new System.EventHandler(this.RadGrid1_PreRender);
RadGrid1.ItemDataBound +=
new Telerik.Web.UI.GridItemEventHandler(this.RadGrid1_ItemDataBound);
RadGrid1.UpdateCommand +=
new GridCommandEventHandler(this.RadGrid1_UpdateCommand);
RadGrid1.InsertCommand +=
new GridCommandEventHandler(this.RadGrid1_InsertCommand);
RadGrid1.DeleteCommand +=
new GridCommandEventHandler(this.RadGrid1_DeleteCommand);
RadGrid1.MasterTableView.CommandItemDisplay =
GridCommandItemDisplay.Top;
//RadGrid1.MasterTableView.EditFormSettings.UserControlName = "~/BackOffice/Groups/Group.ascx";
RadGrid1.MasterTableView.EditFormSettings.EditFormType =
GridEditFormType.AutoGenerated;
RadGrid1.MasterTableView.EditFormSettings.EditColumn.UniqueName =
"EditCommandColumn1";
RadGrid1.MasterTableView.ExpandCollapseColumn.ButtonType =
GridExpandColumnType.ImageButton;
RadGrid1.MasterTableView.ExpandCollapseColumn.UniqueName =
"ExpandColumn";
RadGrid1.MasterTableView.ExpandCollapseColumn.Visible =
false;
GridButtonColumn buttoncolumn;
//buttoncolumn = new GridButtonColumn();
//buttoncolumn.UniqueName = "Image1";
//buttoncolumn.ButtonType = GridButtonColumnType.ImageButton;
//buttoncolumn.CommandName = "Select";
//RadGrid1.MasterTableView.Columns.Add(buttoncolumn);
string veditColumnName = "GroupID";
string vcArg = "";
int vcount = -1;
string vtype = "Image";
GridTemplateColumn veditColumn = new GridTemplateColumn();
veditColumn.ItemTemplate =
new editTemplate(veditColumnName, vcArg, vcount, vtype);
RadGrid1.MasterTableView.Columns.Add(veditColumn);
GridBoundColumn boundColumn;
boundColumn =
new GridBoundColumn();
boundColumn.DataField =
"Title";
boundColumn.HeaderText = title;
boundColumn.SortExpression =
"Title";
boundColumn.UniqueName =
"Title";
RadGrid1.MasterTableView.Columns.Add(boundColumn);
boundColumn =
new GridBoundColumn();
boundColumn.DataField =
"Description";
boundColumn.HeaderText = description;
boundColumn.SortExpression =
"Description";
boundColumn.UniqueName =
"Description";
boundColumn.MaxLength = 500;
RadGrid1.MasterTableView.Columns.Add(boundColumn);
GridDropDownColumn boundDropDown;
boundDropDown =
new GridDropDownColumn();
boundDropDown.DataField =
"Audiency";
boundDropDown.HeaderText = audiency;
boundDropDown.SortExpression =
"Audiency";
boundDropDown.UniqueName =
"Audiency";
RadGrid1.MasterTableView.Columns.Add(boundDropDown);
boundColumn =
new GridBoundColumn();
boundColumn.DataField =
"CreatedDt";
boundColumn.HeaderText = createddt;
boundColumn.SortExpression =
"CreatedDt";
boundColumn.UniqueName =
"CreatedDt";
RadGrid1.MasterTableView.Columns.Add(boundColumn);
boundColumn =
new GridBoundColumn();
boundColumn.DataField =
"UpdatedDt";
boundColumn.HeaderText = updateddt;
boundColumn.SortExpression =
"UpdatedDt";
boundColumn.UniqueName =
"UpdatedDt";
RadGrid1.MasterTableView.Columns.Add(boundColumn);
buttoncolumn =
new GridButtonColumn();
buttoncolumn.HeaderText = delete;
buttoncolumn.Text = delete;
buttoncolumn.ConfirmText = strconfirmdelete;
buttoncolumn.ButtonType =
GridButtonColumnType.ImageButton;
buttoncolumn.ImageUrl =
"~/Images/grid/delete.gif";
buttoncolumn.CommandName =
"Delete";
RadGrid1.MasterTableView.Columns.Add(buttoncolumn);
//Add the RadGrid instance to the controls
this.PlaceHolder1.Controls.Add(RadGrid1);
}