Development in: c# winforms without any database connections
c# winforms
Description: In my DataGridView, the columns were dynamically generated. At some point, some of the columns should be the DataGridViewLinkColumn property. I was tried differently, but did not achieve this.
I hope someone here helps me :)
Thanks in advance.
You need to disable AutoGenerateColumnsand then create each column yourself.
AutoGenerateColumns
Set the normal columns as a type DataGridViewTextBoxColumn, then for the columns that should be Linked columns set them as a type DataGridViewLinkColumn.
DataGridViewTextBoxColumn
DataGridViewLinkColumn
:
DataGridViewLinkColumn links = new DataGridViewLinkColumn(); links.HeaderText = "Hello"; links.UseColumnTextForLinkValue = true; links.Text="http://microsoft.com"; links.ActiveLinkColor = Color.White; links.LinkBehavior = LinkBehavior.SystemDefault; links.LinkColor = Color.Blue; links.TrackVisitedState = true; links.VisitedLinkColor = Color.YellowGreen; dataGridView.Columns.Add(links);