M.Bouabdallah
M.Bouabdallah

Reputation: 772

Devexpress TabHeader Disappears

I have created ribbon form (XtraMain)and I set IsMdiContainer Property to true,i also add documentManager controle i set MdiParent to XtraMain I have add this code to open child forms

public void ViewChildForm(XtraForm _form)
    {
        if (!IsFormActived(_form))
        {
            _form.MdiParent = this;
            _form.Show();
        }

    }
  private bool IsFormActived(XtraForm form)
    {
        bool IsOpenend = false;
        if (MdiChildren.Count() > 0)
        {
            foreach (var item in MdiChildren)
            {
                if (form.Name == item.Name)
                {

                    tabbedView1.ActivateDocument(item);
                    IsOpenend = true;
                }

            }
        }
        return IsOpenend;
    }

and i use this code in click of button to open the child form

        private void bbtnEmployee_ItemClick(object sender, ItemClickEventArgs e)
    {
        FrmEmployee frme = new FrmEmployee();
        frme.Name = "FrmEmployee";
        ViewChildForm(frme);
    }

my problem start when the form contain a LayoutControl for example i have this code that open on click of button

        private void btnBonLivraison_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
    {
        LayoutControl lc = new LayoutControl();
        lc.Dock = DockStyle.Top;
        LookUpEdit OrderNumber = new LookUpEdit();
        OrderNumber.Properties.TextEditStyle = TextEditStyles.DisableTextEditor;
        OrderNumber.Properties.DataSource = shippProdu.GetOrderNumber();
        OrderNumber.Properties.DisplayMember = "N° Bon de livraison";
        OrderNumber.Properties.ValueMember = "N° Bon de livraison";
        lc.AddItem(Resources.selectOrderNumber, OrderNumber).TextVisible = true;
        lc.Height = 70;
        this.Controls.Add(lc);
        this.Dock = DockStyle.Top;
        lc.BestFit();

the second I click on a button the tabHeader disappears,what cause this problem?and how can I solve it.before I use documentManager I used XtraTabControl and if i click a button to open LayoutControl and after that try to open another form the focus remaining in the first form even when the form two is already opened and if I want to go to form two I must first click on a tab of the first form and then click on tab of the second form , thanks in advance . this is my main form enter image description here

and this is when the eader disappears enter image description here

Upvotes: 0

Views: 396

Answers (1)

Svetlana
Svetlana

Reputation: 421

If DocumentManager resides within the same form to which you add LayoutControl, it is the expected behavior. DocumentManager places a special documents' host onto the main form and set its Dock property to Fill. That is why it is incorrect to place LayoutControl onto the same form and dock it to form edges.

If you need to show tabbed documents and LayoutControl on the same form simultaneously, do not use the MDI mode. Consider the use of a separate UserControl. Place your DocumentManager there. Then, put this UserControl onto your form. Note that in this case UserControl's Dock property should be set to Top or Bottom since LayoutControl should fill all available area or vice versa.

Upvotes: 1

Related Questions