Solved

Change datalist color based upon SQL query

Posted on 2007-12-05
8
527 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

840 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