p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 31st, 2006, 03:00 AM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Sydney, NSW, Australia.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to bind colors to controls in an formview

Hi All,

It took me hours of searching the net not to find the solution but managed to find the solution by experiment!

You have a control within a formview and the Forecolor is bound to it.

Your sql table has a field called "Forecolor" with the value "RED" for type = text.

Bind the control with the following;
ForeColor='<%# system.drawing.color.fromname(Eval("ForeColor")) %>'
This works for anything with color.

FromName takes the "Red" string and converts to proper system.drawing.color!

Something else;

The Borderstyle = int
so for a solid border enter 1
Bind the control with the following;

BorderStyle='<%# Eval("BorderStyle") %>'

If you want to find the other values for borderstyle then -

"Me.Button1.BorderStyle = BorderStyle.Dotted" mouse over BorderStyle.Dotted to get int value of 2. Get my drift!

I hope this is of any help to anyone searching for a quick and easy answer.

Regards
Paul




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FormView - access DropDownList controls kgaughan ASP.NET 2.0 Basics 0 July 29th, 2008 02:40 PM
Validation controls and FormView templates bpdsmark BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 September 28th, 2006 09:56 AM
Accessing Controls in FormView cryspe ASP.NET 2.0 Basics 0 May 16th, 2006 04:59 PM
changing colors in standards controls gbianchi Pro VB 6 6 September 22nd, 2005 04:11 PM
Changing colors of numerous disabled controls mariak Pro VB.NET 2002/2003 3 February 26th, 2004 06:18 AM



All times are GMT -4. The time now is 02:17 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc