Ustawianie wybranej wartości na liście rozwijanej z listy kodów w repeaterze w widoku formularza

Oto sytuacja. Mam listę rozwijaną w przemienniku, która znajduje się wewnątrz formview.

Naprawdę szczególną rolę odgrywa to, że repeater jest używany do dynamicznego dodawania wielu wierszy danych.

Próbowałem i nie udało mi się ustawić wybranej wartości listy rozwijanej.

<asp:FormView ID="FormView3" runat="server" DataKeyNames="t_id" 
                DataSourceID="SqlDataSource25" DefaultMode="Insert">    
                <InsertItemTemplate>
                    t_p_id:
                    <asp:TextBox ID="t_p_idTextBox" runat="server" Text='<%# Bind("t_p_id") %>' />
                        <br />

                    t_step:
                    <asp:TextBox ID="t_stepTextBox" runat="server" Text='<%# Bind("t_step") %>' />
                    <br />
                    t_foreclosure_date:
                    <asp:TextBox ID="t_foreclosure_dateTextBox" runat="server" 
                        Text='<%# Bind("t_foreclosure_date") %>' />
                    <br />
                    t_date:
                    <asp:TextBox ID="t_dateTextBox" runat="server" Text='<%# Bind("t_date") %>' />
                    <br />

                    <hr />

                    <asp:Repeater ID="repeater1" runat="server" OnPreRender="repeater1_PreRender" OnItemCommand="repeater1_ItemCommand" >  
                    <HeaderTemplate>
                        <table cellpadding="5" cellspacing="5">
                        <tr style="padding-top: 5px;">
                            <td colspan="7">
                                <asp:Label ID="lblInstructions" runat="server" Text="Add entries here:" />
                            </td>
                        </tr>
                        <tr runat="server" id="trHeader" style="font-weight: bold;">
                            <td>Date</td>
                            <td>Cost</td>
                            <td>Type</td>
                            <td>Comment</td>
                            <td></td>
                            <td></td>
                            <td></td>
                        </tr>         
                    </HeaderTemplate> 
                    <ItemTemplate>
                        <tr>
                            <td><asp:TextBox ID="txtDate" runat="server" Width="55" 
                                 Text='<%#DataBinder.Eval(Container.DataItem, "date", "{0:d}")%>' /> </td>
                            <td><asp:TextBox ID="txtAmount" runat="server" Width="55"             
                                 Text='<%#DataBinder.Eval(Container.DataItem, "amount")%>' /> </td>

                            <td>
                                 <asp:DropDownList ID="ddlType" runat="server" DataSourceID="SqlDataSource26" 
                                    DataTextField="tt_type" DataValueField="tt_id"   ></asp:DropDownList>
                                  </td>

                                 <td><asp:TextBox ID="txtComment" runat="server" Width="300" 
                                 Text='<%#DataBinder.Eval(Container.DataItem, "comment")%>' /> </td>
                            <td style="text-align: center;">
                                <asp:Button ID="btnMoveUp" runat="server" Width="70" 
                                 Text="Move Up" CommandName="Up" 
                                 CommandArgument='<%# Container.ItemIndex %>' />
                            </td>
                            <td style="text-align: center;">
                                <asp:Button ID="btnMoveDown" runat="server" Width="90" 
                                 Text="Move Down" CommandName="Down" 
                                 CommandArgument='<%# Container.ItemIndex + 1 %>' />
                            </td>
                            <td style="text-align: center;">
                                <asp:Button ID="btnRemove" runat="server" Width="70" 
                                 Text="Remove" CommandName="Remove" 
                                 CommandArgument='<%# Container.ItemIndex %>' />
                            </td>
                        </tr>
                    </ItemTemplate> 
                    <FooterTemplate>
                        <tr style="padding-top: 5px;">
                           <td colspan="6">
                               <asp:Button ID="btnAdd" runat="server" 
                                Text="Add Row" CommandName="Add" />
                           </td>
                        </tr>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>


                    <hr />
                    <asp:CheckBoxList ID="tpTransmittalsDoclist" runat="server" DataSourceID="SqlDataSource13" 
                        DataTextField="document_name" DataValueField="document_id">
                        </asp:CheckBoxList>

                    <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                        CommandName="Insert" Text="Insert" />
                    &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server" 
                        CausesValidation="False" CommandName="Cancel" Text="Cancel" />
                </InsertItemTemplate>
            </asp:FormView>

Po załadowaniu strony w kodzie wstawiam wartości fikcyjne w pierwszym wierszu przemiennika. Używam kosztu klasy do ustawienia / przechowywania wartości dla wiersza repeatera. ale nie mogę dowiedzieć się, jak ustawić wybraną wartość listy rozwijanej, gdy utworzę przemiennik. Próbowałem kilku różnych rzeczy, ale bez radości. jakieś pomysły?

// load up costs in transmittals tab
    if (!Page.IsPostBack)
    {
        Costs mycost = new Costs();
        string date = DateTime.Now.ToShortDateString();
        Costs.Cost cost1 = new Costs.Cost(date, "1.99", 2, "1");
        mycost.Add(cost1);

        Repeater r = FormView3.FindControl("repeater1") as Repeater;
        r.DataSource = mycost;
        r.DataBind();
    }

Edytuj: Jeśli używasz liczby całkowitej. Będziesz chciał użyć.

 SelectedIndex='<%#DataBinder.Eval(Container.DataItem, "type")%>'

questionAnswers(2)

yourAnswerToTheQuestion