Ramco Ramco

Ramco Ramco

  • 435
  • 3.4k
  • 547k

DropDown in Repeater

Oct 20 2022 4:56 PM

Hi

  I have Repeater . In Dropdown it has 2 values . I want if Dropdown value in Database is 1 then Yes should be selected else No.

<asp:Repeater ID="rptBulkData" runat="server">
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td>
                                                                <asp:HiddenField ID="hdfID" runat="server" Value='<%# Eval("ID") %>' />
                                                                <asp:Literal ID="ltrlNum" Text="<%# Convert.ToString(Container.ItemIndex + 1) %>" runat="server"></asp:Literal></td>
                                                            <td>
                                                                <asp:Literal ID="ltrlSessionDeliveryNumber" runat="server" Text='<%# Eval("Number") %>'>
                                                            <td>
                                                                <asp:DropDownList ID="ddlBreak" runat="server">
                                                                    <asp:ListItem Value="1" Text="Yes"></asp:ListItem>
                                                                    <asp:ListItem Value="0" Text="No"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            
                                                        </tr>
                                                    </ItemTemplate>
                                                </asp:Repeater>

Thanks 


Answers (4)