Binding data to a server control inside repeator control

Discussion in 'ASP .Net' started by muthu, Apr 6, 2006.

  1. muthu

    muthu Guest

    Hi guys,

    Iam using a repeator control in my page.In wich i have
    dropdown list as the last column.I have a label in the first
    column.Now i have binded a datable to the repeator in the page load
    event.And assigned vale to the label in html as

    <asp:Label ID="c_invAmt" Runat="server" cssclass="smcsAmountLabel">
    <%# DataBinder.Eval(Container.DataItem,"InvoiceAmount") %>
    </asp:Label>


    Now i want to bind data to the dropdown list in the last column.I have
    a function that returns a datatable.

    I tried to bind the dropdown in html as follows

    <asp:DropDownList ID="c_currencyList" Runat="server" Visible="False"
    DataSource='<%=GetCurrencies()%>' DataTextField="XXX"
    DataValueField="XXX">
    </asp:DropDownList>

    But it throws an error saying

    The datasource property is set only by the run time.It cannot be
    declared.

    So i tried to bind the dropdown list in the itemdatabound event of the
    repeator.But the data is not binded to the dropdown list.

    How can i achieve that.Can any one help me out...........
     
    muthu, Apr 6, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pat Sagaser via .NET 247
    Replies:
    0
    Views:
    2,533
    Pat Sagaser via .NET 247
    May 13, 2004
  2. Steve Lloyd
    Replies:
    2
    Views:
    394
    Steve Lloyd
    May 19, 2004
  3. muthu

    Doubt in repeator control

    muthu, Apr 5, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    350
    Eliyahu Goldin
    Apr 5, 2006
  4. muthu
    Replies:
    3
    Views:
    1,281
    =?Utf-8?B?Y2xpY2tvbg==?=
    Apr 6, 2006
  5. cs_in_va

    Display Images with Repeator

    cs_in_va, Mar 5, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    293
    sloan
    Mar 5, 2008
Loading...

Share This Page