Solved

Change datalist color based upon SQL query

Posted on 2007-12-05
8
510 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Class object 2 27
Host asp.net pages 5 25
consuming an asmx web service in winforms application 3 24
Show/Hide ASP.NET controls with JQuery best practices 3 18
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

15 Experts available now in Live!

Get 1:1 Help Now