, , , , , .
, , , , datagrid, :
<asp:HyperLinkcolumn DataNavigateUrlField="Username"
DataNavigateUrlFormatString="PersonForm.aspx?Username={0}"
HeaderText="More Details"
Text="View Person Details" />
PersonForm . , , itemcommand, .
, .
: winforms : DataGridViewLink MSDN
:
DataGridViewLinkColumn links = new DataGridViewLinkColumn();
links.UseColumnTextForLinkValue = true;
links.HeaderText = ColumnName.ReportsTo.ToString();
links.DataPropertyName =
links.ActiveLinkColor = Color.White;
links.LinkBehavior = LinkBehavior.SystemDefault;
links.LinkColor = Color.Blue;
links.TrackVisitedState = true;
links.VisitedLinkColor = Color.YellowGreen;
DataGridView1.Columns.Add(links);
After you added the link, you can catch it using DataGridView1_CellContentClick and do what you want with it, that is, open a new form or change the current one.
source
share