I've a problem where i need to get the total number of columns, which defines the total columns. Currently i have a function which dictates the header text on the DataGrid.columns.
public static string ColumnHeader1 = Properties.Settings.Default.ColumnHeader1;
public void dataGridHeaders()
{
dataGrid.Columns[0].Header = ColumnHeader1;
dataGrid.Columns[1].Header = ColumnHeader2;
dataGrid.Columns[2].Header = ColumnHeader3;
dataGrid.Columns[3].Header = ColumnHeader4;
dataGrid.Columns[4].Header = ColumnHeader5;
dataGrid.Columns[5].Header = ColumnHeader6;
dataGrid.Columns[6].Header = ColumnHeader7;
dataGrid.Columns[7].Header = ColumnHeader8;
}
the string vars being read in from an xml settings file. What i'm looking to do is depending on how many strings in the xml file depicts how many columns there will be at runtime. Or adding an int var say..
public static int totalNumberOfColumns = 8;
and then iterating through a loop adding the columns.
are any of these ways possible?