예제 #1
0
        public virtual void SetGroup()
        {
            string groupName = this.GroupName.IsEmpty()
                                   ? this.ClientID + "_Group"
                                   : this.GroupName;

            foreach (Radio item in this.Items)
            {
                RadioColumn rCol = item as RadioColumn;

                if (rCol != null)
                {
                    foreach (Component comp in rCol.Items)
                    {
                        Radio radio = comp as Radio;

                        if (radio != null && (radio.Name.IsEmpty() || this.AutomaticGrouping))
                        {
                            radio.SuspendScripting();
                            radio.Name = groupName;
                            radio.ResumeScripting();
                        }
                    }
                }
                else
                {
                    if (item.Name.IsEmpty() || this.AutomaticGrouping)
                    {
                        item.SuspendScripting();
                        item.Name = groupName;
                        item.ResumeScripting();
                    }
                }
            }
        }
예제 #2
0
        protected override void AfterItemAdd(Observable item)
        {
            base.AfterItemAdd(item);

            Radio radio = (Radio)item;

            if (!this.DesignMode && this.AutomaticGrouping)
            {
                string groupName = this.GroupName.IsEmpty()
                                   ? this.ClientID + "_Group"
                                   : this.GroupName;

                RadioColumn rCol = radio as RadioColumn;

                if (rCol != null)
                {
                    foreach (Component comp in rCol.Items)
                    {
                        Radio radioItem = comp as Radio;

                        if (radioItem != null && (radioItem.Name.IsEmpty() || this.AutomaticGrouping))
                        {
                            radioItem.SuspendScripting();
                            radioItem.Name = groupName;
                            radioItem.ResumeScripting();
                        }
                    }
                }
                else
                {
                    if (radio.Name.IsEmpty() || this.AutomaticGrouping)
                    {
                        radio.SuspendScripting();
                        radio.Name = groupName;
                        radio.ResumeScripting();
                    }
                }
            }
        }
예제 #3
0
        protected override void AfterItemAdd(Observable item)
        {
            base.AfterItemAdd(item);

            if (!this.DesignMode && this.AutomaticGrouping)
            {
                Radio radio = item as Radio;

                string groupName = this.GroupName.IsEmpty()
                                   ? this.ClientID + "_Group"
                                   : this.GroupName;

                if (radio != null)
                {
                    if (radio.Name.IsEmpty() || this.AutomaticGrouping)
                    {
                        radio.SuspendScripting();
                        radio.Name = groupName;
                        radio.ResumeScripting();
                    }
                }
                else if (item is IItems)
                {
                    IItems items = (IItems)item;
                    foreach (Observable comp in items.ItemsList)
                    {
                        Radio radioItem = comp as Radio;

                        if (radioItem != null && (radioItem.Name.IsEmpty() || this.AutomaticGrouping))
                        {
                            radioItem.SuspendScripting();
                            radioItem.Name = groupName;
                            radioItem.ResumeScripting();
                        }
                    }
                }
            }
        }