I NEED HELP FAST

arcana

New Member
ok for a listbox I can add an item like this:<BR><BR>PayFrequency.Items.Insert(0, new ListItem("blah"));<BR><BR>or like this:<BR><BR>PayFrequency.Items.Add("blah");<BR><BR>The problem is that both the value and text properties are the same. I want to make the text prop. something like "Monday" while the value is something like 1.<BR><BR>Any help please!!!!!!!!Perhaps this, create a System.Data.DataTable (from a datasource or in memory), bind the Listbox (datasource) to your datatable, set the ListBox.DataTextField to the column name for the view field and for the value set the ListBox.DataValueField to the value field.<BR><BR>Try:<BR><BR>PayFrequency.Items.Insert(0, New ListItem("1", "Monday")
 
Back
Top