Note how the column names are defined using LINQ to Objects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (EomAppCommon.Settings.DebugEomDatabase) | |
{ | |
var form = new System.Windows.Forms.Form(); | |
var grid = new System.Windows.Forms.DataGridView { | |
AutoGenerateColumns = true, | |
Dock = System.Windows.Forms.DockStyle.Fill, | |
DataSource = | |
(from c in new [] { | |
Tuple.Create("DADatabaseR1ConnectionString", this.DADatabaseR1ConnectionString), | |
Tuple.Create("StatsYear", this.StatsYear.ToString()), | |
Tuple.Create("StatsMonth", this.StatsMonth.ToString()), | |
Tuple.Create("StatsDaysInMonth", this.StatsDaysInMonth.ToString()), | |
Tuple.Create("PubReportSubjectLine", this.PubReportSubjectLine), | |
} select new { | |
Key = c.Item1, | |
Value = c.Item2, | |
}).ToList(), | |
AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill, | |
}; | |
form.Controls.AddRange(new[] { grid, }); | |
form.ShowDialog(); | |
} |
No comments:
Post a Comment