Solved

Change datalist color based upon SQL query

Posted on 2007-12-05
8
496 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
 

Author Comment

by:edrz01
ID: 20413566
Ok, is there a way to search the datalist for values returned by the SQL query?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 10

Accepted Solution

by:
Alpesh Patel earned 500 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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.…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now