Link to home
Create AccountLog in
Avatar of Ed
EdFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Highlighting Dropdownlist row depending on data from datasource

I have a SQL datasource on a page which populates a dropdown menu.

               <asp:SqlDataSource ID="DSUnitAvailable0" runat="server" ConnectionString="<%$ ConnectionStrings:IRISConnectionString %>" SelectCommand="GET_AVAILABLE_QUALSCHEME_UNITS_IVRECORD" SelectCommandType="StoredProcedure">
                            <asp:SessionParameter Name="IVRECORDID"  SessionField="IVRECORDID" />

Open in new window

<asp:DropDownList ID="ddlUNIT02ID1" runat="server" AppendDataBoundItems="True" CssClass="selectpickedr" data-live-search="true" DataSourceID="DSUnitAvailable0" DataTextField="QUALSCHEMEUNIT" DataValueField="QUALSCHEMEUNITID">
                 <asp:ListItem Selected="True" Value="0">-</asp:ListItem>

Open in new window

I also have another field being returned by the datasource which is called ' Highlight' . This can either be 1 or 0.  

What I'd like to do is highlight the row on the dropdown menu if 'the field 'Highlight'    is  1
Avatar of Randy Downs
Randy Downs
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account