Hash Tables and dropdownlists

johnsonberlin

New Member
I have an ASP Data Grid and my other hash table for dept works like a charm but for some pricky reason a seperate hash table for Rank won't display the value that is in the database. The sql statement is correct since when you search the grid it shows up but when I update it always puts the first item in the drop down box. Any ideas why it would be doing it for one and not the other?<BR><BR>My code:<BR><BR>VB code:<BR><BR> ManSupIndex = New Hashtable()<BR> ManSupIndex("exec") = 0<BR> ManSupIndex("manager") = 1<BR> ManSupIndex("z") = 2<BR><BR>asp datagrid column layout:<BR><BR><asp:TemplateColumn HeaderText="Rank"> <BR> <ItemTemplate> <BR><asp:Label runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "mansup") %>'/> <BR> </ItemTemplate> <BR> <EditItemTemplate> <BR><asp:DropDownList runat="server" SelectedIndex='<%# ManSupIndex(Container.DataItem("mansup")) %>' id="mansup"><BR> <asp:ListItem value=http://aspmessageboard.com/archive/index.php/"z">Employee</asp:ListItem><BR> <asp:ListItem value="manager">Manager</asp:ListItem><BR> <asp:ListItem value="exec">Executive</asp:ListItem><BR></asp:DropDownList><BR></EditItemTemplate> <BR> </asp:TemplateColumn> <BR><BR>Matt
 
Back
Top