Inheritance: ReorderListItemEventArgs
示例#1
0
    void ReorderList4_ItemReorder(object sender, AjaxControlToolkit.ReorderListItemReorderEventArgs e)
    {
        DataTable table = ((DataView)((AjaxControlToolkit.ReorderList)sender).DataSource).Table;

        ViewState["DT"] = table;
        ReorderList4.DataBind();
    }
示例#2
0
    void ReorderList3_ItemReorder(object sender, AjaxControlToolkit.ReorderListItemReorderEventArgs e)
    {
        TrackViewState();

        ReorderList3.DataSource = IListDataSource;
        ReorderList3.DataBind();
    }
        protected void TicketTypesOrderList_ItemReorder(object sender, ReorderListItemReorderEventArgs e)
        {
            TicketTypesOrderList.EditItemIndex = -1;
            string itemToMove = OrderedTypes[e.OldIndex];
            OrderedTypes.Remove(itemToMove);
            OrderedTypes.Insert(e.NewIndex, itemToMove);

            SettingsManager.TicketTypesList = OrderedTypes.ToArray();
        }
示例#4
0
    protected void rlTemplate_ItemReorder(object sender, AjaxControlToolkit.ReorderListItemReorderEventArgs e)
    {
        ChapterVersion chapterVers = new ChapterVersion();

        IList <ChapterVersion> allChapters = DocoManager.GetAllItemsByArticleId(ArticleId);

        HiddenField lblIdSender = (HiddenField)e.Item.FindControl("hdnId");

        //item moving down  -- all items below it will move up starting from the new index
        if (e.NewIndex > e.OldIndex)
        {
            for (int i = e.NewIndex; i > e.OldIndex; i--)
            {
                HiddenField lblId = (HiddenField)ReorderList1.Items[i].FindControl("hdnId");
                chapterVers = allChapters.First(x => x.Id.Equals(lblId.Value));

                chapterVers.Sequence = i - 1;
                BusiBlocks.DocoBlock.DocoManager.UpdateChapterVersion(chapterVers);
            }
        }
        else if (e.NewIndex < e.OldIndex)
        {
            for (int i = e.NewIndex; i < e.OldIndex; i++)
            {
                HiddenField lblId = (HiddenField)ReorderList1.Items[i].FindControl("hdnId");
                chapterVers = allChapters.First(x => x.Id.Equals(lblId.Value));

                chapterVers.Sequence = i + 1;
                BusiBlocks.DocoBlock.DocoManager.UpdateChapterVersion(chapterVers);
            }
        }

        //update the item itself
        chapterVers = allChapters.First(x => x.Id.Equals(lblIdSender.Value));

        chapterVers.Sequence = e.NewIndex;
        BusiBlocks.DocoBlock.DocoManager.UpdateChapterVersion(chapterVers);

        BindSequence();
    }
示例#5
0
        protected void LstEnabledFiles_Reorder(object sender, ReorderListItemReorderEventArgs e)
        {
            CmsTheme theme = GetSelectedTheme();

            //Get the original order of the items
            IList<JavascriptFile> files = JavascriptManager.Instance.List(this.GetSelectedTheme());
            IList<JavascriptFile> enabledFiles = new List<JavascriptFile>();
            foreach (JavascriptFile file in files)
            {
                if (file.IsEnabled)
                    enabledFiles.Add(file);
            }

            //Reorder the item
            JavascriptFile movedFile = enabledFiles[e.OldIndex];
            enabledFiles.RemoveAt(e.OldIndex);
            enabledFiles.Insert(e.NewIndex, movedFile);

            //Update the ordering of all the items
            int i = 0;
            foreach (JavascriptFile file in enabledFiles)
            {
                file.SortOrder = i++;
                JavascriptManager.Instance.UpdateSortInfo(theme, file.Name, i++);
            }

            LoadTabData();
        }
    protected void lstEstimates_Reorder(object sender, ReorderListItemReorderEventArgs e)
    {
        Estimate moved = estimateQueue[e.OldIndex];
        estimateQueue.RemoveAt(e.OldIndex);
        estimateQueue.Insert(e.NewIndex, moved);

        int i = 1;
        foreach (Estimate est in estimateQueue)
        {
            est.Priority = i++;
            est.Save();
        }

        Cache["Estimates"] = estimateQueue;
    }