J
Jeff Petter
I'm having a tough time with this, and I can't find any resources that address it. I have a DataGrid comprised of Template Columns, in which I have both TextBox and DropDownList controls. The purpose of the DataGrid is to allow users to edit previously made selections, and I am using a DataSet and a DataView to load the XML data into. The idea is so that when the grid loads, it is populated with the data from the XML source. It works great for the TextBoxes, but I can't get the syntax down right for the DropDownList controls. Depending upon how I edit the code, I either get an error informing me that the control doesn't exist in the namespace, which it clearly does. Or I get the list items: one letter per row, in the box. In my previous and limited experience with asp.net, I've done all my binding in the "code behind" page, but all the examples I saw embedded the code in the HTML code, so that is what I've done.
Here is one binding statement:
<aspropDownList id=ddExceptions runat="server" DataSource='<%# DataBinder.Eval(Container, "DataItem.exception") %>' Width="173px"> - This results in displaying the list items, but only one letter per row. So, I decided to try the SelectedIndex property and have the binding statement:
<aspropDownList id=ddExceptions runat="server" SelectedIndex='<%# ddExceptions.SetIndex(DataBinder.Eval(Container, "DataItem.exception")) %>' Width="173px">
This results in error essages stating that 'ddExceptions' does not exist in the namespace. And I've played with the syntax for over a day, all to no avail. Does anyone know ANY way to do this, or have any ideas that I might try?
I appreciate it a bunch. BTW, FWIW, the code is in c#.
Thanks,
Jeff
Here is one binding statement:
<aspropDownList id=ddExceptions runat="server" DataSource='<%# DataBinder.Eval(Container, "DataItem.exception") %>' Width="173px"> - This results in displaying the list items, but only one letter per row. So, I decided to try the SelectedIndex property and have the binding statement:
<aspropDownList id=ddExceptions runat="server" SelectedIndex='<%# ddExceptions.SetIndex(DataBinder.Eval(Container, "DataItem.exception")) %>' Width="173px">
This results in error essages stating that 'ddExceptions' does not exist in the namespace. And I've played with the syntax for over a day, all to no avail. Does anyone know ANY way to do this, or have any ideas that I might try?
I appreciate it a bunch. BTW, FWIW, the code is in c#.
Thanks,
Jeff