-
-
Save evilz/52b68b8ce0296f914312ad1ad8470399 to your computer and use it in GitHub Desktop.
Data grid in F#
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
// The form | |
let form = new Form(Visible = true, Text = "Data grid #1", | |
TopMost = true, Size = Drawing.Size(600,600)) | |
// The grid | |
let data = new DataGridView(Dock = DockStyle.Fill, Text = "Data grid", | |
Font = new Drawing.Font("Lucida Console", 10.0f), | |
ForeColor = Drawing.Color.DarkBlue) | |
form.Controls.Add(data) | |
// Some data | |
data.DataSource <- [| ("ORCL", 32.2000, 31.1000, 31.1100, 0.0100); | |
("MSFT", 72.050, 72.3100, 72.4000, 0.0900) |] | |
// Set column headers | |
do data.Columns.[0].HeaderText <- "Symb" | |
do data.Columns.[1].HeaderText <- "Last sale" | |
do data.Columns.[2].HeaderText <- "Bid" | |
do data.Columns.[3].HeaderText <- "Ask" | |
do data.Columns.[4].HeaderText <- "Spread" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment