• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

list (List) where the first value has supported repeated

good night, I need to create a list (List) where the first value has supported repeated, for example
1, aaaa
1, bbbb
1, cccc
also to indicate as those values can be read
0
enrique_aeo
Asked:
enrique_aeo
  • 2
1 Solution
 
jandromedaCommented:
Can you describe this a little bit more?
0
 
Anurag ThakurCommented:
you can create a class with two members and add that class in list

class test
{
   public int i;
   publci text = string.Empty;
   public test()
   {
   }

    public void test(int I, string Text)
    {
        i = I;
        text = Text;
    }
}

List <test> list = new List<test> ();
list.Add(new text(1, "aaaa");
list.Add(new text(1, "bbbb");
list.Add(new text(1, "cccc");
0
 
enrique_aeoAuthor Commented:
Hi, i have this error (view file)
errCLASS.JPG
0
 
Anurag ThakurCommented:
i didnt paste the complete working code
i just gave you the prototype of the class which you can use to add in a generic list <T> and then you have use the bottom addition into the list to add to the list items and then later bind that to the dropdown
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now