My Form has a fixed size of 1024x600 (dataGridView has 1022 width). When I'm trying to read the XML with this code every Column has the same width and column 10, 11, 12 and 13 are not even shown because they are outside.
private void btLoadXML_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable("itemstable");
dt.Columns.Add("Datum", typeof(System.String));
dt.Columns.Add("1", typeof(System.String));
dt.Columns.Add("2", typeof(System.String));
dt.Columns.Add("3", typeof(System.String));
dt.Columns.Add("4", typeof(System.String));
dt.Columns.Add("5", typeof(System.String));
dt.Columns.Add("6", typeof(System.String));
dt.Columns.Add("7", typeof(System.String));
dt.Columns.Add("8", typeof(System.String));
dt.Columns.Add("9", typeof(System.String));
dt.Columns.Add("10", typeof(System.String));
dt.Columns.Add("11", typeof(System.String));
dt.Columns.Add("12", typeof(System.String));
dt.Columns.Add("13", typeof(System.String));
//Read XML File And Display Data in GridView
dt.ReadXml("items2.xml");
dataGridView1.DataSource = dt;
}
How can I adjust the width of each column manually, so everything will fit in?