Click here to Skip to main content
15,911,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to bind data to checkboxlist control from a dictionary collecttion written in a .cs file in the same project.This dictionary collection is having an enum and we have to bind the values to checkboxlist control..

Reply is highly appreciated !!!!
Posted
Comments
Tarun.K.S 1-Apr-11 3:00am    
Please provide the code, show us where you got stuck?
VipulJain03 1-Apr-11 4:24am    
I am attaching the ContactsManager.cs having Dictionary collection
using System.Collections.Generic;

public static class ContactsManager
{
// Do not modify this class.

private static Dictionary<contactcategory, string[]=""> _contacts;

static ContactsManager()
{
_contacts = new Dictionary<contactcategory, string[]="">(3);

_contacts.Add(ContactCategory.CoWorkers,
new string[] { "McTaggart", "Des", "Ian" });
_contacts.Add(ContactCategory.Family,
new string[] { "Simon", "Brian", "David" });
_contacts.Add(ContactCategory.Friends,
new string[] { "Tony", "Barry", "Mary" });
}

public static string[] GetListOfContacts(ContactCategory category)
{
return _contacts[category];
}
}

From here I want to bind the data (values) into checkboxlist control.
sekharkaza 1-Apr-11 4:55am    
Hey vipul,
Can u be a little clear, u want to bind all the three string arrays to chklist or the enums or what??
BobJanova 1-Apr-11 5:04am    
Yes, you need to describe more clearly what the problem is. You will probably have to write a model-view or data binding intermediary class if you're trying to data bind to something which is a custom class, though.
pankajupadhyay29 1-Apr-11 5:34am    
what shuld be displayed in checkbox list

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900