DropDownList in Datagrid OK but how to select corr

Jessica

New Member
I have a DropDownList in a DataGrid EditTemplate which works fine except that when editing a record I want the fields value to be automatically selected in the drop down. Rather than starting at the first item in the list.<BR><BR>How can I do this ?<BR><BR>Thanks,<BR><BR>MilesMyList.SelectedIndex = 1<BR><BR>Providing you put your own declaration where I put "MyList"<BR><BR>You can then call the ID of the field where I put 1 and it will then select that. SelectedIndex can only take integers, hope I helpedThanks for your reply but my problem is where in the code do I assign the index to the lists selected index.<BR><BR>I have a function called DataEdit which is called when users click edit in the EditCommandColumn. <BR><BR>void DataEdit(Object Sender, DataGridCommandEventArgs e) {<BR>gridTestCats.EditItemIndex = e.Item.ItemIndex;<BR>BindGrid();<BR>}<BR><BR>But I cannot access the drop down list from this function because it does not yet exist. <BR><BR>Anymore help appreciated.<BR><BR>Miles<BR>
 
Back
Top