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

[Solved] Selected Index

0 Answers 40 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Betti
Top achievements
Rank 1
Betti asked on 12 Jun 2012, 03:44 AM
I have problem when I wanna edit one form in my project. That form show the detail of one transaction.
There are combobox there. Combo box TransactionType, take the data from Model.Types, and then I want set the value of that combobox.

From table Payment, I get IdType = 2. The decription "2" is CNDJ
then I try to set the value of he combobox. But it's show the wrong description. It's show RBNC, because the SelectedIndex give new index there. How I can set the default value of combobox like as data in Payments.IdType.

this Is my code :

<%= Html.Telerik().ComboBox() .Name("TransactionType").BindTo(new SelectList(Model.Types, "Id", "Name")) .SelectedIndex(int.Parse(Payments.IdType))%>

Thanks.
Tags
ComboBox
Asked by
Betti
Top achievements
Rank 1
Share this question
or