This question is locked. New answers and comments are not allowed.
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.
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.