Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a Repeater with checkbox and a textbox. All is fine, databinds, i can click the checkbox etc..

 

I want to add a dropdowlist . I found an exmaple on 4guys about adding a dropdownlist to DataGrid and that works fine in a datagrid. I used the same example in Repeater but I get an error when code tries to bind to Repeater.

 

This is what I have:

<asp:repeater id="rpAct" runat="server">

<HeaderTemplate>

...

</HeaderTemplate>

<ItemTemplate>

...

<td><asp:DropDownList id="ddlActTypes" DataValueField="code_id" DataTextField="code_desc" DataSource="<%# GetActList() %>" SelectedIndex='<%# GetSelActIndex(Container.DataItem("code_id")) %>' Visible="true" runat="server">

</asp:DropDownList>

</td>

...

I have a routine to for GetActList and GetSelActIndex. Those work too But the Error happens when I Bind:

 

rpAct.Databind()

 

with this error

'System.Data.DataRowView' does not contain a property with the name code_desc

 

I'm open to suggestions if there's another way of doing this

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...