Note that there are some explanatory texts on larger screens.

plurals
  1. POshow all columns in datagridview
    primarykey
    data
    text
    <p>Basically I have the following code to bring up 3 different datagrid views depending on the button clicked.</p> <pre><code> public partial class ChooseDB : Form { private DataGridView doctorsDataGridView = new DataGridView(); private DataGridView patientsDataGridView = new DataGridView(); private DataGridView hospitalsDataGridView = new DataGridView(); public ChooseDB() { InitializeComponent(); } public void buttonDoctorsDB_Click(object sender, EventArgs e) { doctorsDataGridView.DataSource = doctorsDataSet.Doctors; doctorsDataGridView.Dock = DockStyle.Right; if (Controls.Contains(patientsDataGridView)) Controls.Remove(patientsDataGridView); if (Controls.Contains(hospitalsDataGridView)) Controls.Remove(hospitalsDataGridView); this.Controls.Add(doctorsDataGridView); } public void buttonPatientsDB_Click(object sender, EventArgs e) { patientsDataGridView.DataSource = patientsDataSet.Patients; patientsDataGridView.Dock = DockStyle.Right; if (Controls.Contains(doctorsDataGridView)) Controls.Remove(doctorsDataGridView); if (Controls.Contains(hospitalsDataGridView)) Controls.Remove(hospitalsDataGridView); this.Controls.Add(patientsDataGridView); } public void buttonHospitalsDB_Click(object sender, EventArgs e) { hospitalsDataGridView.DataSource = hospitalsDataSet.Hospitals; hospitalsDataGridView.Dock = DockStyle.Right; if (Controls.Contains(patientsDataGridView)) Controls.Remove(patientsDataGridView); if (Controls.Contains(doctorsDataGridView)) Controls.Remove(doctorsDataGridView); this.Controls.Add(hospitalsDataGridView); } } </code></pre> <p>}</p> <p>So far so good, but the table that it brings up is all "smooshed" to the right</p> <p>I've checked up on autosizing but haven't found how to apply it to my code specifically. I would like it to show all the columns, instead of just showing the first two and then giving a scrollbar at tha bootom.</p> <p>I'm assuming here that autosizing is the right way to go, if not please set me on the right path.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload