protected void listBoxSelectedSites_Dropped(object sender, RadListBoxDroppedEventArgs e)
    {
        if (e.HtmlElementID == listBoxSites.ClientID)
        {
            if (listBoxSites.SelectedItem != null)
            {
                foreach (RadListBoxItem item in e.SourceDragItems)
                {
                    bool flag = true;

                    RadListBoxItem dItem = new RadListBoxItem(item.Text, item.Value);

                    foreach (RadListBoxItem selectedItem in listBoxSelectedSites.Items)
                    {
                        if (selectedItem.Value == dItem.Value)
                        {
                            flag = false;
                        }
                    }

                    if (flag)
                    {
                        listBoxSelectedSites.Items.Add(dItem);
                    }
                }
            }
        }
    }
Exemplo n.º 2
0
        void box_Dropped(object sender, RadListBoxDroppedEventArgs e)
        {
            RadListBox box = sender as RadListBox;

            if (e.HtmlElementID != box.ClientID)
            {
                ChangeItemsDisabled(e.SourceDragItems);
                IsTransferring = false;
            }
            else
            {
                ChangeItesOrder(box.Items);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Handles the OnDropped event of the rlb control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="Telerik.Web.UI.RadListBoxDroppedEventArgs"/> instance containing the event data.</param>
        protected void rlb_OnDropped(object sender, RadListBoxDroppedEventArgs e)
        {
            var activityType = ActivityType.FillForm;

            switch (((RadListBox)sender).ID)
            {
            case "rblViewPages":
                activityType = ActivityType.ViewPage;
                break;

            case "rlbForms":
                activityType = ActivityType.FillForm;
                break;

            case "rlbFiles":
                activityType = ActivityType.DownloadFile;
                break;
            }

            foreach (var item in e.SourceDragItems)
            {
                var docksCondition = new DocksCondition
                {
                    Id           = Guid.NewGuid(),
                    ActivityType = activityType,
                    ActualPeriod = 180
                };
                if (((RadListBox)sender).ID != "rblViewPages")
                {
                    docksCondition.SiteActivityRuleId = item.Value.ToGuid();
                }
                else
                {
                    docksCondition.Code = item.Value;
                }
                DocksConditions.Add(docksCondition);
                AddRadDock(docksCondition);
            }
        }
Exemplo n.º 4
0
        protected void RadListBox1_ItemDropped(object sender, RadListBoxDroppedEventArgs e)
        {
            if (e.HtmlElementID == RadTreeView1.ClientID)
            {
                if (RadTreeView1.SelectedNode != null)
                {
                    foreach (RadListBoxItem item in e.SourceDragItems)
                    {
                        RadTreeNode node = new RadTreeNode(item.Text);
                        if (RadTreeView1.SelectedNode.Level == 0)
                        {
                            RadTreeView1.SelectedNode.Nodes.Add(node);
                        }
                        else
                        {
                            RadTreeView1.SelectedNode.InsertAfter(node);
                        }

                        item.Remove();
                    }
                }
            }
        }