Esempio n. 1
0
        private void AddNewItem()
        {
            if (_activeItem == null)
            {
                return;
            }

            // Get the picklist so we add to it's items
            PickList picklist = _activeItem.Tag as PickList;

            // Add a NULL item to the end of the list which we then edit to create the new item
            PickItem nullPickItem = new PickItem();

            nullPickItem.Name     = "New PickItem";
            nullPickItem.ParentID = picklist.PicklistID;
            //added for fixing Bug No 859 Sojan E John, KTSInfotech

            FormAddPickItem form = new FormAddPickItem(nullPickItem, _activeItem);

            if (form.ShowDialog() == DialogResult.OK)
            {
                RefreshTab();
            }

            //UltraListViewItem lvi = new UltraListViewItem(nullPickItem, null);
            //lvi.Tag = nullPickItem;
            //ulvPickItems.Items.Add(lvi);

            //// Begin to edit the item
            //EditItem(lvi);
        }
Esempio n. 2
0
        /// <summary>
        /// Begin editing of a listview item
        /// </summary>
        /// <param name="lvi"></param>
        private void EditItem(UltraListViewItem lvi)
        {
            // Allow editing
            //this.ulvPickItems.ItemSettings.AllowEdit = Infragistics.Win.DefaultableBoolean.False;
            //lvi.BeginEdit();

            PickItem pickItem = lvi.Tag as PickItem;

            if (pickItem != null)
            {
                FormAddPickItem form = new FormAddPickItem(pickItem, _activeItem);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    RefreshTab();
                }
            }
        }