Exemplo n.º 1
0
        protected void OnDashboardControlsItemChecked(object sender, DNNDataGridCheckChangedEventArgs e)
        {
            var propertyName  = e.Field;
            var propertyValue = e.Checked;
            var isAll         = e.IsAll;
            var index         = e.Item.ItemIndex;

            DashboardControl dashboardControl;

            if (isAll)
            {
                //Update All the properties
                foreach (DashboardControl dashboard in DashboardControlList)
                {
                    switch (propertyName)
                    {
                    case "IsEnabled":
                        dashboard.IsEnabled = propertyValue;
                        break;
                    }
                }
            }
            else
            {
                //Update the indexed property
                dashboardControl = DashboardControlList[index];
                switch (propertyName)
                {
                case "IsEnabled":
                    dashboardControl.IsEnabled = propertyValue;
                    break;
                }
            }
            BindGrid();
        }
Exemplo n.º 2
0
        /// <summary>
        /// grdProfileProperties_ItemCheckedChanged runs when a checkbox in the grid
        /// is clicked
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	02/23/2006  Created
        /// </history>
        private void grdProfileProperties_ItemCheckedChanged(object sender, DNNDataGridCheckChangedEventArgs e)
        {
            string propertyName  = e.Field;
            bool   propertyValue = e.Checked;
            bool   isAll         = e.IsAll;
            int    index         = e.Item.ItemIndex;

            ProfilePropertyDefinitionCollection properties = GetProperties();
            ProfilePropertyDefinition           profProperty;

            if (isAll)
            {
                //Update All the properties
                foreach (ProfilePropertyDefinition tempLoopVar_profProperty in properties)
                {
                    profProperty = tempLoopVar_profProperty;
                    switch (propertyName)
                    {
                    case "Required":

                        profProperty.Required = propertyValue;
                        break;

                    case "Visible":

                        profProperty.Visible = propertyValue;
                        break;
                    }
                }
            }
            else
            {
                //Update the indexed property
                profProperty = properties[index];
                switch (propertyName)
                {
                case "Required":

                    profProperty.Required = propertyValue;
                    break;

                case "Visible":

                    profProperty.Visible = propertyValue;
                    break;
                }
            }

            BindGrid();
        }
Exemplo n.º 3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// grdProfileProperties_ItemCheckedChanged runs when a checkbox in the grid
        /// is clicked.
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// -----------------------------------------------------------------------------
        private void grdProfileProperties_ItemCheckedChanged(object sender, DNNDataGridCheckChangedEventArgs e)
        {
            string propertyName  = e.Field;
            bool   propertyValue = e.Checked;

            if (e.IsAll)
            {
                // Update All the properties
                foreach (ProfilePropertyDefinition profProperty in this.ProfileProperties)
                {
                    switch (propertyName)
                    {
                    case "Required":
                        profProperty.Required = propertyValue;
                        break;

                    case "Visible":
                        profProperty.Visible = propertyValue;
                        break;
                    }
                }
            }
            else
            {
                // Update the indexed property
                ProfilePropertyDefinition profileProperty = this.ProfileProperties[e.Item.ItemIndex];
                switch (propertyName)
                {
                case "Required":
                    profileProperty.Required = propertyValue;
                    break;

                case "Visible":
                    profileProperty.Visible = propertyValue;
                    break;
                }
            }

            this.BindGrid();
        }