I need to populate a dgv's ColumnHeaders in this way:
Name 1 2...
Sunday Monday ...
So first column is for Names - header is single line.
Each other column has twoLines header:
first line is date in currentMonth
second line is name of that day.
So, dgv.Columns.Count is always = currentMonth.DaysInMonth.Count + 1
dgv is unbounded.
I allready have a long, repeating "foreach" procedure, which works, and if needed I can post it, but I need as short as possible way, probably something with arrays.
Thanks in Advance.
Loading

VulpesPosted Jul 2, 2012, 5:02 AM
MementoPosted Jul 2, 2012, 6:01 AM
I will ensure that dgv.Column.Count is adjusted by the days.Count - it's ok.
This lines are crucial for me:
dataGridView1.Columns[i].HeaderText = String.Format("{0}\r\n{1}", i, dt.DayOfWeek);
dt = dt.AddDays(1);
ThankYou - for Your Knowledge,ThankYou - for ShorTimeAnswering.