DataGridViewLinkCell::TrackVisitedState Property
Gets or sets a value indicating whether the link changes color when it is visited.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Property Value
Type: System::Booleantrue if the link changes color when it is selected; otherwise, false. The default is true.
When false, the LinkVisited property will not be automatically set to true when visited.
Setting the TrackVisitedState property of the owning column also sets the TrackVisitedState property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value.
The following code example demonstrates the use of the DataGridViewLinkColumn::TrackVisitedState property, which is similar to this property. This example is part of a larger example available in the DataGridViewComboBoxColumn class overview topic.
private: void AddLinkColumn() { DataGridViewLinkColumn^ links = gcnew DataGridViewLinkColumn(); links->UseColumnTextForLinkValue = true; links->HeaderText = ColumnName::ReportsTo.ToString(); links->DataPropertyName = ColumnName::ReportsTo.ToString(); links->ActiveLinkColor = Color::White; links->LinkBehavior = LinkBehavior::SystemDefault; links->LinkColor = Color::Blue; links->TrackVisitedState = true; links->VisitedLinkColor = Color::YellowGreen; DataGridView1->Columns->Add(links); }
Available since 2.0