This is a migrated thread and some comments may be shown as answers.

Radlistbox

1 Answer 60 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 05 Aug 2009, 02:48 AM
Hi,

1) Can anyone tell me how to bind a radlistbox to a list<class>.

I have a list<class>.
I need to bind listbox to it?? how do i implement this in c#

listbox1.datasource = ??
listbox1.???
Pls do help me with code.

2) also can anyone tell me how to bind radlist box to an enum???

Thanks,
ZR

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 05 Aug 2009, 10:10 AM
Hello Zaheka,

Here is some sample code

var list = new List<MyClass>();
listBox.DataSource = list;
listBox.DataTextField = "SomePropertyOfMyClass";
listBox.DataBind();

And here is how to bind it to an enum:

listBox.DataSource = Enum.GetNames(typeof (SomeEnum));
listBox.DataBind();

I hope this helps,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ListBox
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or