C# 无法设置组合框显示格式的元组列表

C# 无法设置组合框显示格式的元组列表,c#,.net,winforms,tuples,C#,.net,Winforms,Tuples,你好,有一个组合框,我需要把它放在一个元组值列表中,但是我只想要每个元组值的第一项 List<Tuple<string, decimal, string>> SourceData= new List<Tuple<string, decimal, string>>() ComboBox.DataSource = new BindingSource(sourceData,null); for (int

你好,有一个组合框,我需要把它放在一个元组值列表中,但是我只想要每个元组值的第一项

        List<Tuple<string, decimal, string>> SourceData= new List<Tuple<string, decimal, string>>()

        ComboBox.DataSource = new BindingSource(sourceData,null);
        for (int i = 0; i < SourceData.Count; i++)
        {
            ComboBox.DisplayMember = SourceData[i].Item1.ToString();

        }
*除了真实的数据

我怎样才能让它成为第一根弦呢

编辑

我目前的工作方案是:

for (int i = 0; i < SourceData.Count; i++)
{
    ComboBox.DisplayMember = SourceData.ToDataTable().Columns[0].ToString();
}
请尝试以下代码:

List<Tuple<string, decimal, string>> sourceData = new List<Tuple<string, decimal, string>>
{
    new Tuple<string, decimal, string>("str11", 1, "str12"),
    new Tuple<string, decimal, string>("str21", 2, "str22"),
};

comboBox1.DataSource = new BindingSource(sourceData, null);
comboBox1.DisplayMember = "Item1";

DisplayMember是一个字符串,如果数据源由对象组成,则表示用于显示的字段的名称。

尽管知道它很有用,但仍然会导致下拉列表显示整个元组,而不是元组的第一个值。为什么它是设计的;不能改变它。
List<Tuple<string, decimal, string>> sourceData = new List<Tuple<string, decimal, string>>
{
    new Tuple<string, decimal, string>("str11", 1, "str12"),
    new Tuple<string, decimal, string>("str21", 2, "str22"),
};

comboBox1.DataSource = new BindingSource(sourceData, null);
comboBox1.DisplayMember = "Item1";