Пример #1
0
        private void Items_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
        {
            oReflejantes.Clear();
            extender.UpdateItems(sender, e);
            int Count = 0;

            try {
                foreach (GridViewRowInfo item in this.extender.AssociatedRadMultiColumnComboBox.EditorControl.Rows)
                {
                    if (item.Tag != null && item.Tag.ToString() == Boolean.TrueString)
                    {
                        if (Count <= int.Parse(txtCavidades.Text))
                        {
                            ReflejantesBE obj = new ReflejantesBE();
                            obj.Id     = int.Parse(item.Cells["Id"].Value.ToString());
                            obj.Nombre = item.Cells["Nombre"].Value.ToString();

                            oReflejantes.Add(obj);
                            Count += 1;
                        }
                        else
                        {
                            RadMessageBox.Show("Solo es posible seleccionar máximo: " + txtCavidades.Text + " Reflejantes del producto seleccionado", this.Text, MessageBoxButtons.OK, RadMessageIcon.Exclamation);
                            oReflejantes.Clear();
                        }
                    }
                }
            } catch (Exception ex) {
                RadMessageBox.Show("Ocurrió un error al agregar la selección\n" + ex.Message, this.Text, MessageBoxButtons.OK, RadMessageIcon.Error);
                oReflejantes.Clear();
            }
        }
Пример #2
0
 private void OnNotifyCollectionChanged(Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     if (this.updateCount == 0 && this.CollectionChanged != null)
     {
         this.CollectionChanged(this, e);
     }
 }
Пример #3
0
 protected override void OnCollectionChanged(Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     base.OnCollectionChanged(e);
     if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Add)
     {
         foreach (GanttViewTextViewColumn newItem in (IEnumerable)e.NewItems)
         {
             newItem.Owner = this.Owner;
             newItem.Initialize();
         }
     }
     this.Owner.TextViewElement.Update(RadGanttViewElement.UpdateActions.Reset);
     this.Owner.TextViewElement.InvalidateMeasure(true);
 }
Пример #4
0
        void groups_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
        {
            if (e.NewItems != null &&
                (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Add ||
                 e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Replace))
            {
                foreach (ListViewDataItemGroup item in e.NewItems)
                {
                    item.Owner = this.owner;
                }
            }

            if (e.OldItems != null &&
                (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove ||
                 e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Replace))
            {
                foreach (ListViewDataItemGroup item in e.OldItems)
                {
                    item.Owner = null;
                }
            }

            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Batch ||
                e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Reset)
            {
                foreach (ListViewDataItemGroup item in this)
                {
                    item.Owner = this.owner;
                }
            }

            if (sender == this.customGroups && this.owner.EnableCustomGrouping)
            {
                this.OnNotifyCollectionChanged(e);
            }
            else if (sender == this.autoGroups && !this.owner.EnableCustomGrouping)
            {
                this.OnNotifyCollectionChanged(e);
            }
        }