R
Rob
I want to be able to color code my dropdown list based on the status
of the users within the list. I have a SQL Query (stored Procedure)
that return the following data. (UserID, UserName, Status).
I bind the data like this from returning the data from a
SqlDataReader:
' dropdownlisting of all users
With UserList
.DataSource = GetUsersDropDown()
.DataTextField = "vcUserName"
.DataValueField = "vcUserID"
.DataBind()
.Items.Insert(0, "-- Select a User --")
.SelectedIndex = 0
End With
The GetUsersDropDown Function:
Public Function GetUsersDropDown() As SqlDataReader
Dim dr As SqlDataReader
Dim strConn = New
SqlConnection(HttpContext.Current.Application("strConn"))
Dim cmdSelect = New SqlCommand("spSOCSRListX", strConn)
cmdSelect.CommandType = CommandType.StoredProcedure
strConn.Open()
dr = cmdSelect.ExecuteReader()
Return dr
strConn.Close()
End Function
The Function returns data like (10, Joe Burns, 1). I want to be able
to identify the status (3rd column) or the user and based on the
results (1-active, 0-inactive). Color the dropdown item a either red
or white.
Please help Im getting desperate....
Many Thanks
of the users within the list. I have a SQL Query (stored Procedure)
that return the following data. (UserID, UserName, Status).
I bind the data like this from returning the data from a
SqlDataReader:
' dropdownlisting of all users
With UserList
.DataSource = GetUsersDropDown()
.DataTextField = "vcUserName"
.DataValueField = "vcUserID"
.DataBind()
.Items.Insert(0, "-- Select a User --")
.SelectedIndex = 0
End With
The GetUsersDropDown Function:
Public Function GetUsersDropDown() As SqlDataReader
Dim dr As SqlDataReader
Dim strConn = New
SqlConnection(HttpContext.Current.Application("strConn"))
Dim cmdSelect = New SqlCommand("spSOCSRListX", strConn)
cmdSelect.CommandType = CommandType.StoredProcedure
strConn.Open()
dr = cmdSelect.ExecuteReader()
Return dr
strConn.Close()
End Function
The Function returns data like (10, Joe Burns, 1). I want to be able
to identify the status (3rd column) or the user and based on the
results (1-active, 0-inactive). Color the dropdown item a either red
or white.
Please help Im getting desperate....
Many Thanks