.NET 10
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net10.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
</Project>
open System.Windows.Forms
type App() as x =
class
inherit ApplicationContext()
do
x.MainForm <- new Form(Text = "App v1", Width = 300, Height = 200)
let dg = new DataGridView(SelectionMode = DataGridViewSelectionMode.FullRowSelect)
x.MainForm.Controls.Add dg
dg.Dock <- DockStyle.Fill
let addCol name =
dg.Columns.Add(new DataGridViewColumn(HeaderText = name, CellTemplate = new DataGridViewTextBoxCell()))
|> ignore
addCol "Id"
addCol "Name"
dg.Rows.Add([| box 1; box "Alice" |]) |> ignore
dg.Rows.Add([| box 2; box "Bob" |]) |> ignore
dg.Rows.Add([| box 3; box "Rob" |]) |> ignore
static member Run() = Application.Run(new App())
end
App.Run()
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
no
Issue description
With free or object source and SelectionMode = DataGridViewSelectionMode.FullRowSelect first column header cell
selected at startup.
I did not check but found example worked without issue if source DataTable.
Steps to reproduce
Make WinForms App
Add DataGridView with one or more columns
add object datasource or fill rows by hands and test.
.NET 10
Did it work in .NET Framework?
Yes
Did it work in any of the earlier releases of .NET Core or .NET 5+?
no
Issue description
With free or object source and SelectionMode = DataGridViewSelectionMode.FullRowSelect first column header cell
selected at startup.
I did not check but found example worked without issue if source DataTable.
Steps to reproduce
Make WinForms App
Add DataGridView with one or more columns
add object datasource or fill rows by hands and test.