Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Change datalist color based upon SQL query

Posted on 2007-12-05
8
Medium Priority
?
548 Views
Last Modified: 2008-02-01
I have a datalist which is loaded at run time from Access. What I am trying to do is when I click on a button will execute a SQL query to another database and if any of the data returned from the SQL query toggle the background color of the matching item in the datalist. So once the SQL query runs it will search the datalist for a match and then if it finds one then it will colorcode it.
0
Comment
Question by:edrz01
  • 5
  • 3
8 Comments
 
LVL 10

Expert Comment

by:Alpesh Patel
ID: 20412736
Is this web page or Winform
plz let me know

0
 

Author Comment

by:edrz01
ID: 20412933
Sorry, webform. 2005
0
 
LVL 10

Expert Comment

by:Alpesh Patel
ID: 20413457
You can not play with the background color of perticular Item in the Listbox or Dropdowncombo box
for the webpage
 <asp:ListItem></aspListItem> is the control for the item in the ListBox and DropDownCombo box
and  <asp:ListItem> doesn't have the Backcolor attribute or similar to that
so you can change whole background color of Listbox or DropdownCombobox but can not change color or Item

sorry
thanx
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:edrz01
ID: 20413566
Ok, is there a way to search the datalist for values returned by the SQL query?
0
 
LVL 10

Accepted Solution

by:
Alpesh Patel earned 2000 total points
ID: 20413752
You can use GridView

and keep that GridView with Single columns. and make Design like Listbox
u can change color of cells or gridview as per the returned value of SQL
if u are good designer too then u can Design GridView as like as ListBox
thanx
0
 

Author Comment

by:edrz01
ID: 20414013
Fair enough - now is there a way to layout the gridview for multiple columns?
0
 
LVL 10

Expert Comment

by:Alpesh Patel
ID: 20414308
ya of course you can do it
its depends on you how u use GridView

some of thing you have to do with tricky method

thanx
0
 
LVL 10

Expert Comment

by:Alpesh Patel
ID: 20414500
I Request you to change your Question type to Programming asp.net rather then VB.net

for the point prospect
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question