DropDownList in DataGrid

G

Guest

I have a DataGrid populated with some data. In the grid, I have placed a
DropDownListBox.
The DropDownListBox's current item should be retrieved from Dataset 'A'.
However, the items in
the DropDownListBox should be retrieved from another DataSet 'B'.

So, I call a function GetLibraryItems() to return the dataset 'B'.

However, the compiler gives the following error.

DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with
the name CE GULF EAST.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Web.HttpException: DataBinder.Eval:
'System.Data.DataRowView' does not contain a property with the name CE GULF
EAST.

Any idea on how to resolve this error?



<asp:TemplateColumn HeaderText="Division">
<EditItemTemplate>
<asp:DropDownList id=DropDownList2 runat="server" Width="171px"
DataValueField='<%# DataBinder.Eval(Container,"DataItem.str_divn") %>'
DataTextField='<%# DataBinder.Eval(Container,"DataItem.str_divn") %>'
DataSource ='<%# GetLibraryItems() %>'>
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateColumn>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top