Is it possible to have a combobox on a simple input form display the values from one table, but when the combobox is opened, has all of the available values from the 2nd table.
For example, a form with values from a UserTable and a link to Department table.
I want to display all of the values from the UserTable:
FirstName
LastName
Shift
Phone
Department
But I want Department to be a combobox that displays the appropriate Department for each record in the UserTable when navigating, but when opened, shows all of the Departments from the DepartmentTable.
Is this possible?
Thanks for any help.
shot in the dark - screen image guess...
Use a repeater and tie to a datasource to generate master grid and then embed a dropdownlist (also linked to datasource) inside repeater in column 4 of my example
I included HTML and code snipets for screen print...
</head>
<body>
<h3>Repeater Example</h3>
<form id="form1" runat="server">
<b>Repeater1:</b>
<br />
<asp:Repeater id="Repeater1" runat="server">
<HeaderTemplate>
<table border="1">
<tr>
<td>First</td>
<td>Last</td>
<td>Something</td>
<td>Department</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td> <%# Container.DataItem %> </td>
<td> <%# Container.DataItem %> </td>
<td> <%# Container.DataItem %> </td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>111111</asp:
<asp:ListItem>222222</asp:
<asp:ListItem>33333333</as
<asp:ListItem>4444444</asp
</asp:DropDownList>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
<br />
</form>
</body>
</html>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim values As New ArrayList()
values.Add("Apple")
values.Add("Orange")
values.Add("Pear")
values.Add("Banana")
values.Add("Grape")
' Set the DataSource of the Repeater.
Repeater1.DataSource = values
Repeater1.DataBind()
Dim values2 As New ArrayList()
values2.Add("2Apple")
values2.Add("2Orange")
values2.Add("2Pear")
values2.Add("2Banana")
values2.Add("2Grape")
' Set the DataSource of the Repeater.
Repeater1.DataSource = values
Repeater1.DataBind()
End If
End Sub