コード例 #1
0
        // end of method

        private void PopulateDisplayNames(ListReportView wp, ref SPGridView grv)
        {
            if (!string.IsNullOrEmpty(wp.DisplayListNames))
            {
                _hashedNames = wp.GetListNamesInHashtable(wp.DisplayListNames);
            }
            if (!string.IsNullOrEmpty(wp.SelectedListNames))
            {
                _selectedHashNames = wp.GetListNamesInHashtable(wp.SelectedListNames);
            }
            for (int idx = 0; idx < grv.Rows.Count; idx++)
            {
                CheckBox        selectCtl      = (CheckBox)grv.Rows[idx].FindControl("selectedList");
                TextBox         txtBox         = (TextBox)grv.Rows[idx].FindControl("selectDisplayName");
                HtmlInputHidden listHiddenName = (HtmlInputHidden)grv.Rows[idx].FindControl("listIdItem");

                if (_selectedHashNames != null && _selectedHashNames.Count > 0)
                {
                    if (_selectedHashNames.ContainsKey(listHiddenName.Value.ToString()))
                    {
                        selectCtl.Checked = true;
                    }
                }
                string sDisplayName = listHiddenName.Value.ToString();
                if (_hashedNames != null && _hashedNames.Count > 0)
                {
                    if (_hashedNames.ContainsKey(sDisplayName))
                    {
                        sDisplayName = _hashedNames[sDisplayName].ToString();
                    }
                }
                txtBox.Text = sDisplayName;
            }
        }
コード例 #2
0
        public override void ApplyChanges()
        {
            ToolPane       tp   = this.ParentToolPane;
            ListReportView myWP =
                (ListReportView)tp.SelectedWebPart;
            var gridviewwithcheckbox = (SPGridView)this.FindControl("mySPGridViewControl");

            //string newVal = Page.Request["reportViewLists"];
            //if (!string.IsNullOrEmpty(newVal.Trim()))
            //{
            //    newVal = newVal.Replace("\r\n", "|");
            //}
            //myWP.ViewLists = newVal;

            bool result = false;

            bool.TryParse(Page.Request["cbExpandView"], out result);
            myWP.ExpandView = result;

            StoreSortListByDisplayName(myWP, gridviewwithcheckbox);
            _selectedHashNames = myWP.GetListNamesInHashtable(myWP.SelectedListNames);
            SortListByDisplayName(_selectedHashNames, myWP);
        }