Ejemplo n.º 1
0
 protected virtual void OnCollectionChanged(Telerik.WinControls.Data.NotifyCollectionChangedEventArgs args)
 {
     if (this.CollectionChanged == null)
     {
         return;
     }
     this.CollectionChanged((object)this, args);
 }
Ejemplo n.º 2
0
 private void ProcessOldItems(Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     foreach (ListViewDataItem oldItem in (IEnumerable)e.OldItems)
     {
         oldItem.Group = (ListViewDataItemGroup)null;
         oldItem.Owner = (RadListViewElement)null;
         this.owner.SelectedItems.ProcessSelectedItem(oldItem);
         this.owner.CheckedItems.ProcessCheckedItem(oldItem);
     }
 }
Ejemplo n.º 3
0
 private void Rows_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Move)
     {
         try
         {
             UpdateFieldsIndex();
         }
         catch (Exception ex)
         {
             PersianMessageBox.Show(this, "خطا در ثبت اطلاعات" + "\r\n\r\n" + ex.Message);
         }
     }
 }
Ejemplo n.º 4
0
 void Items_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
     {
         foreach (RadTokenizedTextItem item in e.NewItems)
         {
             if (this.rows.ContainsKey(item.Text.Trim()))
             {
                 string itemText = item.Text.Trim();
                 this.rows[itemText].Tag = Boolean.FalseString;
                 this.rows[itemText].InvalidateRow();
             }
         }
     }
 }
Ejemplo n.º 5
0
 private void ProcessNewItems(Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     foreach (ListViewDataItem newItem in (IEnumerable)e.NewItems)
     {
         if (newItem.Owner != null && newItem.Owner != this.owner)
         {
             newItem.Owner.Items.Remove(newItem);
         }
         newItem.Owner = this.owner;
         this.owner.CheckedItems.ProcessCheckedItem(newItem);
         if (newItem.Selected)
         {
             this.owner.SelectedItems.ProcessSelectedItem(newItem);
         }
     }
 }
Ejemplo n.º 6
0
 protected virtual void Rows_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Add || e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
     {
         for (int i = 0; i < this.radGridView1.Rows.Count; i++)
         {
             this.radGridView1.Rows[i].Cells["Row"].Value = i + 1;
         }
     }
     if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Move)
     {
         for (int i = 0; i < this.radGridView1.Rows.Count; i++)
         {
             this.radGridView1.Rows[i].Cells["Row"].Value = i + 1;
         }
     }
 }
Ejemplo n.º 7
0
        private void Rows_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
        {
            GridViewRowCollection rows = sender as GridViewRowCollection;

            if (rows.Owner.MasterTemplate == this.gridBasket.MasterTemplate)
            {
                bool isSummaryRowOnlySelected = this.gridBasket.SelectedRows.Count == 1 && this.gridBasket.SelectedRows[0] is GridViewSummaryRowInfo;
                bool isEnabled = rows.Count > 0 && !isSummaryRowOnlySelected;

                btnReturnAllProducts.Enabled      = isEnabled;
                btnReturnSelectedProducts.Enabled = isEnabled;
            }
            else
            {
                btnCheckoutAllProducts.Enabled      = rows.Count > 0;
                btnCheckoutSelectedProducts.Enabled = rows.Count > 0;
            }
        }
Ejemplo n.º 8
0
        public void Clear()
        {
            this.OwnerListElement.CheckReadyForUnboundMode();

            foreach (RadListDataItem item in this.dataLayer.ListSource)
            {
                item.DataLayer = null;
                item.Owner     = null;
            }

            this.ownerListElement.ActiveItem = null;

            this.dataLayer.ListSource.Clear();

            Telerik.WinControls.Data.NotifyCollectionChangedEventArgs args1 = new Telerik.WinControls.Data.NotifyCollectionChangedEventArgs(Telerik.WinControls.Data.NotifyCollectionChangedAction.Reset);
            this.ownerListElement.OnItemsChanged(args1);
            this.ownerListElement.UpdateSelectedIndexOnItemsChanged();
        }
        void Appointments_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
        {
            InitializeCalendar();
            SaveChanges();
            //MessageBox.Show("change");
            //try
            //{
            //    for (int i = 0; i < e.NewItems.Count; i++)
            //    {

            //        MessageBox.Show(e.PropertyName);
            //        MessageBox.Show(e.NewItems[i].ToString());
            //    }
            //}
            //catch
            //{
            //}
        }
Ejemplo n.º 10
0
        public void RemoveAt(int index)
        {
            this.OwnerListElement.CheckReadyForUnboundMode();

            RadListDataItem itemToRemove = this.dataLayer.DataView[index];

            Telerik.WinControls.Data.NotifyCollectionChangingEventArgs args = new Telerik.WinControls.Data.NotifyCollectionChangingEventArgs(Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove, itemToRemove);
            this.ownerListElement.OnItemsChanging(args);
            if (args.Cancel)
            {
                return;
            }

            itemToRemove.DataLayer = null;
            itemToRemove.Owner     = null;
            this.dataLayer.ListSource.RemoveAt(index);
            Telerik.WinControls.Data.NotifyCollectionChangedEventArgs args1 = new Telerik.WinControls.Data.NotifyCollectionChangedEventArgs(Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove, itemToRemove);
            this.ownerListElement.OnItemsChanged(args1);
        }
Ejemplo n.º 11
0
        public void Insert(int index, RadListDataItem item)
        {
            this.OwnerListElement.CheckReadyForUnboundMode();

            item.DataLayer = this.dataLayer;
            item.Owner     = this.ownerListElement;

            Telerik.WinControls.Data.NotifyCollectionChangingEventArgs args = new Telerik.WinControls.Data.NotifyCollectionChangingEventArgs(Telerik.WinControls.Data.NotifyCollectionChangedAction.Add, item);
            this.ownerListElement.OnItemsChanging(args);

            if (args.Cancel)
            {
                return;
            }
            Telerik.WinControls.Data.NotifyCollectionChangedEventArgs args1 = new Telerik.WinControls.Data.NotifyCollectionChangedEventArgs(Telerik.WinControls.Data.NotifyCollectionChangedAction.Add, item);
            this.dataLayer.ListSource.Insert(index, item);

            this.ownerListElement.OnItemsChanged(args1);
        }
Ejemplo n.º 12
0
        void listElement_ItemsChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Reset)
            {
                if (this.listElement.Items.Count == 0)//reset & no items
                {
                    PopupEditorNotificationData dataReset = new PopupEditorNotificationData();
                    dataReset.context = PopupEditorNotificationData.Context.ItemsClear;
                    this.NotifyOwner(dataReset);
                }

                return;
            }

            PopupEditorNotificationData data = new PopupEditorNotificationData();

            data.context = PopupEditorNotificationData.Context.ItemsChanged;
            this.NotifyOwner(data);
        }
Ejemplo n.º 13
0
        public void AddRange(IEnumerable <RadListDataItem> range)
        {
            this.OwnerListElement.CheckReadyForUnboundMode();

            List <RadListDataItem> items = new List <RadListDataItem>(range);

            Telerik.WinControls.Data.NotifyCollectionChangingEventArgs args = new Telerik.WinControls.Data.NotifyCollectionChangingEventArgs(Telerik.WinControls.Data.NotifyCollectionChangedAction.Batch, items);
            this.ownerListElement.OnItemsChanging(args);
            if (args.Cancel)
            {
                return;
            }

            this.ownerListElement.SuspendItemsChangeEvents = true;
            foreach (RadListDataItem item in range)
            {
                this.Add(item);
            }
            this.ownerListElement.SuspendItemsChangeEvents = false;
            Telerik.WinControls.Data.NotifyCollectionChangedEventArgs args1 = new Telerik.WinControls.Data.NotifyCollectionChangedEventArgs(Telerik.WinControls.Data.NotifyCollectionChangedAction.Batch, items);
            this.ownerListElement.OnItemsChanged(args1);
        }
Ejemplo n.º 14
0
 void Appointments_CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     InitializeCalendar();
 }
Ejemplo n.º 15
0
 virtual public void CollectionChanged(object sender, Telerik.WinControls.Data.NotifyCollectionChangedEventArgs e)
 {
     this.isItemsDirty = this.dropDownList.DataSource == null;//suspend items sync operation if datasource!=null
 }