Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing selected item in DataList through code?

Status
Not open for further replies.

Sashanan2

Programmer
Jul 2, 2004
39
NL
I have a DataList control populated with an Adodc control, and I want to be able to select the first item in the list through code. Is there an easy way to do this? I found that moving in the ADO recordset doesn't affect which item is selected, and the .SelectedItem property which looked promising appears to be read only.


"Any fool can defend his or her mistakes; and most fools do." -- Dale Carnegie
 
Sorry, to be more specific, put in the exact entry you want selected by the DataList into its text property as DataList1.text = "Entry Text" and if such an item exists in the list it will be selected. Good luck and sorry for the vague answer before.
-Max
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top