eramgarden
Contributor
- Joined
- Mar 8, 2004
- Messages
- 579
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><aspropDownList id="ddlActTypes" DataValueField="code_id" DataTextField="code_desc" DataSource="<%# GetActList() %>" SelectedIndex='<%# GetSelActIndex(Container.DataItem("code_id")) %>' Visible="true" runat="server">
</aspropDownList>
</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
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><aspropDownList id="ddlActTypes" DataValueField="code_id" DataTextField="code_desc" DataSource="<%# GetActList() %>" SelectedIndex='<%# GetSelActIndex(Container.DataItem("code_id")) %>' Visible="true" runat="server">
</aspropDownList>
</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