winfrom的DataGridView控件选中行的DataGridViewLinkColumn列字体颜色的改变

         /// <summary>
        /// 当前所选内容更改时发生
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

 private void dgvUserList_SelectionChanged(object sender, EventArgs e)
        {
            for (int i = 0; i < dgvUserList.RowCount; i++)
            {
                DataGridViewLinkCell dgvc = dgvUserList.Rows[i].Cells["Column3"] as DataGridViewLinkCell;
                dgvc.LinkColor = Color.Blue;
            }

            DataGridViewLinkCell dgv;
            dgv = dgvUserList.CurrentRow.Cells["Column3"] as DataGridViewLinkCell;
            dgv.LinkColor = Color.White;
        }

你可能感兴趣的:(datagridview)