开发者

How to Load ID and Name parallely to One combo box at same time in C# .net [closed]

It's difficult to tell what is 开发者_开发问答being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I want answer in C# language and .Net framework


var items =
    new[]
        {
            new { Id = 1, Name = "Test1" },
            new { Id = 2, Name = "Test2" },
        };

comboBox1.DisplayMember = "Name";
comboBox1.ValueMember = "Id";
comboBox1.DataSource = items;

[Edited] Thanks to Homam for the pointing out redundant Item.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜