protected void Page_Init(object sender, EventArgs e) { pnlNewRev.FileUploadFinished += new PXFileUploadEventHandler(pnlNewRev_FileUploadFinished); WikiFileMaintenance graph = (WikiFileMaintenance)ds.DataGraph; string authority = Request.GetWebsiteAuthority().GetLeftPart(UriPartial.Authority); string schema = Request.GetWebsiteAuthority().GetLeftPart(UriPartial.Scheme); graph.GetFileAddress = authority + ResolveUrl("~/Frames/GetFile.ashx"); graph.WebDAVFilePrefix = ("https://" + authority.Substring(schema.Length)) + (string.IsNullOrEmpty(_filesPath) ? string.Empty : ResolveUrl(_filesPath)); graph.GetDavFilePath = GetFilePath; _editButton = new PXFileEditButton(); _editButton.CommandName = "edit"; _editButton.Text = "Edit"; _editButton.NavigateUrl = "about:blank"; _editButton.WordImage = Sprite.Main.GetFullUrl(Sprite.Main.Doc); _editButton.ExcelImage = Sprite.Main.GetFullUrl(Sprite.Main.Excel); _editButton.PowerPointImage = Sprite.Main.GetFullUrl(Sprite.Main.Ppt); _editButton.Enabled = false; _editButton.Visible = false; _editButton.CollectParams = CollectParams.AnyCallback; int idx = ds.ToolBar.Items.Count - 3; PXToolBarItem oldButton = ds.ToolBar.Items["edit"]; if (oldButton != null) { idx = ds.ToolBar.Items.IndexOf(oldButton); ds.ToolBar.Items.Remove(oldButton); } ds.ToolBar.Items.Insert(idx, _editButton); ds.PreRender += ds_PreRender; form.DataBound += form_DataBound; }