将组合框添加到ListViewItem [英] Add combobox to ListViewItem

查看:319
本文介绍了将组合框添加到ListViewItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用C#创建一个Windows窗体应用程序。表单包含一个ListView。这是一个红十字调度员的应用程序。



ListView具有所有单位的列表。每个单元都有一个状态。此状态需要可更改。因此,我想添加一个组合框,所有可用的状态到每个ListViewItem。状态存储在MySql数据库中。



我如何做到这一点?

解决方案

文章,其中详细介绍了如何执行此操作:如何使用ComboBox控件在Visual C#中编辑ListView控件中的数据

您只需更改载入数据的方式。


I'm creating a Windows Form application using C#. The form contains a ListView. It's an application for a Red Cross Dispatcher.

The ListView has a list of all units. Each unit has a status. This status needs to be changeable. Therefore I want to add a comboBox with all available statuses to each ListViewItem. The Statuses are stored in a MySql database.

How can I do this?

解决方案

Here's a Microsoft sample article showing exactly how to do this: How to use a ComboBox control to edit data in a ListView control in Visual C#

You'll just have to change how it loads it's data.

这篇关于将组合框添加到ListViewItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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