如何将DataGridViewLinkColumn属性添加到DataGridView中的动态生成列? [英] How to add DataGridViewLinkColumn property to dynamically generated columns in DataGridView?

查看:92
本文介绍了如何将DataGridViewLinkColumn属性添加到DataGridView中的动态生成列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开发中: c#winforms 没有任何数据库连接

Developing In: c# winforms without any Database Connections

说明:在我的DataGridView中,列是动态生成的。在某些方面,一些列需要是DataGridViewLinkColumn属性。我被许多方式尝试,但没有这样做。

Description: In my DataGridView, columns were dynamically generated.At some point some of the columns need to be DataGridViewLinkColumn property. I was tried in many ways but didn't achive this.

我希望有人从这里帮助我:)

I hope someone from here would help me :)

感谢提前。

推荐答案

您需要关闭 AutoGenerateColumns ,然后自己生成每一列。

You will need to switch off AutoGenerateColumns, then generate each column yourself.

将常规列设置为类型 DataGridViewTextBoxColumn ,然后将需要链接列的列设置为键入 DataGridViewLinkColumn

Setup the normal columns as type DataGridViewTextBoxColumn, then for the columns which need to be Linked columns set them up as type DataGridViewLinkColumn.

这篇关于如何将DataGridViewLinkColumn属性添加到DataGridView中的动态生成列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆