Example #1
0
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            _listViewWebPart = new ListViewWebPart
            {
                ListName    = _list.ID.ToString("B").ToUpper(),
                ViewGuid    = _view.ID.ToString("B").ToUpper(),
                ListViewXml = _view.HtmlSchemaXml,
                ChromeType  = PartChromeType.None
            };

            //Find the ToolBar control and set visible to False
            foreach (Control ctrl in _listViewWebPart.Controls)
            {
                if (ctrl.GetType() == typeof(ViewToolBar))
                {
                    ctrl.Visible = false;
                    break;
                }
            }

            SyncFolder();
            _listViewWebPart.GetDesignTimeHtml();

            Controls.Add(_listViewWebPart);
        }