Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dynamically change size of splitContainer Panel

Tags:

c#

I have a splitContainter control with two horizontal panels. The top panel holds a patient identification banner and bottom panel holds related patient documents and a tree-view.

The patientBanner control is from the UK's NIH and if you click on a button inside the control (double-down arrows at lower right), it will expand to display more information about the patient's address, phone, email, and allergies.

It expands quite nicely, but I don't know how to make the splitContainer adjust so that the top panel can display all of the information.

alt text http://www.intellicure.com/files/DocumentManagerScreenShot.jpg

like image 573
David Walker Avatar asked Oct 23 '25 18:10

David Walker


1 Answers

In the following code fragment I have adjusted my splitter control. I have used my updated control's width to SplitterDistance. Hope it helps.

public DataTable GridView
    {
        get { return dataGridView1.DataSource as DataTable; }
        set { dataGridView1.DataSource = value;
            splitContainer1.SplitterDistance = dataGridView1.Width;
        }
    }
like image 192
Nokib Bin Faruk Avatar answered Oct 26 '25 07:10

Nokib Bin Faruk