Solved

Change datalist color based upon SQL query

Posted on 2007-12-05
8
532 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb.net Configuration, settings file location? 8 44
Filtering a datagrid view 8 34
VB.net VSTO Excel Ribbon error 4 14
Broken .resx file generating errors 18 27
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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 an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

697 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