DataGridView与列表框列 [英] DataGridView with listbox column

查看:106
本文介绍了DataGridView与列表框列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些长文本的数字用逗号分隔
我想显示 DataGridViewTextBoxColumn as ListBox 当点击
我该怎么办?

无需继承。

解决方案

您可以在 DataGridViewTextBoxColumn 中显示多行文本,并使用设计器或代码使该行自动调整大小:




  • 设置


    I have some columns with long text of numbers separated by commas I want to show the DataGridViewTextBoxColumn as ListBox when it is clicked how can i do it?
    Desirably without inheritance.

    解决方案

    You can show a multi-line text in DataGridViewTextBoxColumn and make the row to be auto-size using designer or code this way:

    So it's enough to convert those comma-separated numbers to a Environment.NewLine separated text and show them in DataGridView.

    这篇关于DataGridView与列表框列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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