public override void SyncChanges() { EnsureChildControls(); SPSListExplorer webpart = WebPartToEdit as SPSListExplorer; if (webpart != null) { Debug.WriteLine("*ListGuid:" + ddlLists.SelectedValue); Debug.WriteLine("*ListViewGuid:" + ddlViews.SelectedValue); if (!string.IsNullOrEmpty(webpart.ListGuid)) { ddlLists.SelectedValue = webpart.ListGuid; if (!string.IsNullOrEmpty(webpart.ListViewGuid)) { SPSEditorPartsTools.FillListViews(ddlViews, webpart.ListGuid); ddlViews.SelectedValue = webpart.ListViewGuid; } chkShowNewButton.Checked = webpart.ShowNewButton; chkShowActionsButton.Checked = webpart.ShowActionsButton; chkShowUpButton.Checked = webpart.ShowUpButton; chkShowNumberOfItems.Checked = webpart.ShowNumberOfItems; chkShowBreadCrumb.Checked = webpart.ShowBreadCrumb; chkShowTree.Checked = webpart.ShowTree; chkSortHierarchyTree.Checked = webpart.SortHierarchyTree; } } }
public override bool ApplyChanges() { EnsureChildControls(); SPSListExplorer webpart = WebPartToEdit as SPSListExplorer; if (webpart != null) { webpart.ListGuid = ddlLists.SelectedValue; webpart.ListViewGuid = ddlViews.SelectedValue; webpart.ShowNewButton = chkShowNewButton.Checked; webpart.ShowActionsButton = chkShowActionsButton.Checked; webpart.ShowUpButton = chkShowUpButton.Checked; webpart.ShowNumberOfItems = chkShowNumberOfItems.Checked; webpart.ShowBreadCrumb = chkShowBreadCrumb.Checked; webpart.ShowTree = chkShowTree.Checked; webpart.SortHierarchyTree = chkSortHierarchyTree.Checked; Debug.WriteLine("ListGuid:" + ddlLists.SelectedValue); Debug.WriteLine("ListViewGuid:" + ddlViews.SelectedValue); webpart.ClearControlState(); webpart.ClearCache(); return(true); } return(false); }