本文介绍了将列设为超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在datagrid中创建一个超链接的列,我尝试了以下代码,但似乎该列没有更改为超链接。我的代码出了什么问题?



Hi, I want to make a column in datagrid into a hyperlink, I have tried the following codes, but it seems that the column did not change into a hyperlink. What is wrong with my codes?

XmlReader reader = XmlReader.Create("C:\\Users\\Visual\\Documents\\Visual Studio 2010\\Projects\\FTP Setup\\FTP Setup\\bin\\Debug\\ftpSetup.xml", new XmlReaderSettings());
DataSet ds = new DataSet();

ds.ReadXml(reader);
dtgFTP.DataSource = ds.Tables["Details"];

//to create a hyperlink in datagrid
DataGridViewLinkColumn link = new DataGridViewLinkColumn();
link.DataPropertyName = "FTP_ID";
link.Name = "FTP_ID";
link.LinkColor = Color.Blue;
dtgFTP.Columns.Add(link);

推荐答案

这篇关于将列设为超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 05:19