DevExpress problem Accumulation: documentmanager problem

Source: Internet
Author: User

DevExpress Version: 14.2

Purpose: To create a draggable control browse view

Process:

1, create Documentmanager control: DevExpress.XtraBars.Docking2010.DocumentManager DMUVW;

2, create in the Documentmanager control to add WidgetView:DevExpress.XtraBars.Docking2010.Views.Widget.WidgetView widgetView1;

3. Add document dynamically through code

        /// <summary>        /// Add document         /// </summary>        /// <param name= "Doname" ></param>         Public void Adddocument (string  doname)        {            new  Document ();             = Doname;            DMUVW.VIEW.DOCUMENTS.ADD (BD);        }

Event: Where Uctemp is the custom control

       DmUvw.View.QueryControl + = View_querycontrol        ; Private void View_querycontrol (object  sender, Querycontroleventargs e)        {            string tempvmename = e.document.caption;             New uctemp (tempvmename);             = uctemp;        }

4. Delete Document by code

        /// <summary>        ///Delete Document/// </summary>        /// <param name= "Doname" ></param>         Public voidDeletedocument (stringdoname) {            foreach(Basedocument BDinchDmUvw.View.Documents) {if(Bd. Caption = =doname)                    {DmUvw.View.Documents.Remove (BD); return; }            }        }

Issue: Deletion of document through code often has a problem, the interface is not refreshed after deletion, such as loading 5 document. Delete each, occasionally one or two document is actually deleted, but the interface shows that the problem is not deleted.

Solution: Multiple trials, and eventually accidental discovery of solutions.

1, increase StackGroup:DevExpress.XtraBars.Docking2010.Views.Widget.StackGroup stackGroup1 in WidgetView1;

2, add each document into the stackGroup1.

        /// <summary>        /// Add document         /// </summary>        /// <param name= "Doname" ></param>         Public void Adddocument (string  doname)        {            new  Document ();             = Doname;            DMUVW.VIEW.DOCUMENTS.ADD (BD);            STACKGROUP1.ITEMS.ADD (BD);        }

DevExpress problem Accumulation: Documentmanager problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.