我将字符串数据源列表绑定到gridview,然后我尝试将它们更改为DataGridViewLinkCell,但它没有反映在gridview上。
public ExpandReport(String operation,List<string> dataSource,string companyCode,string DBName, string DType)
{
try
{
InitializeComponent();
this.ex_dataGridView.DefaultCellStyle.Font=new Font("Verdana", 8);
ex_linkLabel.Text = operation;
filteredResult = dataSource;
ex_dataGridView.DataSource = dataSource.ConvertAll(x => new { Value = x });
company_Code = companyCode;
DB_Name = DBName;
D_Type = DType;
if (DType.Equals("QT"))
{
foreach (DataGridViewRow row in ex_dataGridView.Rows)
{
DataGridViewLinkCell linkCell = new DataGridViewLinkCell();
linkCell.Value = row.Cells[0].Value;
row.Cells[0] = linkCell;
}
}
}