Experience in C++, C#, Java and Process : Living in Montreal

* What is my technical experience as a software developer

* What I have learned in the software business

* Where I am heading to in my career

* How to process in a project

Thursday, May 19, 2005

Change color of one cell in the DataGrid control ( C#)

http://datawebcontrols.com/faqs/CustomizingAppearance/ConditionalFormatting.shtml

The DataGrid provides a plethora of properties that can be set to specify the DataGrid's formatting. For example, you can have each consecutive row of a DataGrid alternate between two different colors merely by setting the DataGrid's AlternatingItemStyle's BackColor property.
While the AlternatingItemStyle is a great way to apply different formatting for every other DataGrid row, oftentimes developers want to perform conditional formatting based on the value(s) of a DataGrid row. For example, imagine a DataGrid that displays a list of products, including the product's name and price. Perhaps you want to draw the user's attention to products that are at "bargain-basement" prices. Namely, if a product has a price less than, say, $10.00, you want to have that row highlighted.
This can be accomplished by providing an event handler for the DataGrid's ItemDataBound event. The ItemDataBound fires once for each DataGridItem added to the DataGrid (that is, it fires once for each row that is added to the DataGrid). Essentially, what we need to do is in this event handler, check to see if the price is below the threshold ($10.00, or whatever lower bound you choose). If it is, then we want to set the DataGridItem's BackColor property to Yellow, thereby highlighting the row.

3 Comments:

  • At 5:48 AM , Blogger emiq7ukpf59rjcu said...

    ='Brand New News From The Timber Industry!!'=

    ========Latest Profile==========
    Energy & Asset Technology, Inc. (EGTY)
    Current Price $0.15
    ================================

    Recognize this undiscovered gem which is poised to jump!!

    Please read the following Announcement in its Entierty and
    Consider the Possibilities
    Watch this One to Trade!

    Because, EGTY has secured the global rights to market
    genetically enhanced fast growing, hard-wood trees!

    EGTY trading volume is beginning to surge with landslide Announcement.
    The value of this Stock appears poised for growth! This one will not
    remain on the ground floor for long.

    Keep Reading!!!!

    ===============
    "BREAKING NEWS"
    ===============

    -Energy and Asset Technology, Inc. (EGTY) owns a global license to market
    the genetically enhanced Global Cedar growth trees, with plans to
    REVOLUTIONIZE the forest-timber industry.

    These newly enhanced Global Cedar trees require only 9-12 years of growth before they can
    be harvested for lumber, whereas worldwide growth time for lumber is 30-50 years.

    Other than growing at an astonishing rate, the Global Cedar has a number of other benefits.
    Its natural elements make it resistant to termites, and the lack of oils and sap found in the wood
    make it resistant to forest fire, ensuring higher returns on investments.

    the wood is very lightweight and strong, lighter than Poplar and over twice
    as strong as Balsa, which makes it great for construction. It also has
    the unique ability to regrow itself from the stump, minimizing the land and
    time to replant and develop new root systems.

    Based on current resources and agreements, EGTY projects revenues of $140 Million
    with an approximate profit margin of 40% for each 9-year cycle. With anticipated
    growth, EGTY is expected to challenge Deltic Timber Corp. during its initial 9-year cycle.

    Deltic Timber Corp. currently trades at over $38.00 a share with about $153 Million in revenues.
    As the reputation and demand for the Global Cedar tree continues to grow around the world
    EGTY believes additional multi-million dollar agreements will be forthcoming. The Global Cedar nursery has produced
    about 100,000 infant plants and is developing a production growth target of 250,000 infant plants per month.

    Energy and Asset Technology is currently in negotiations with land and business owners in New Zealand,
    Greece and Malaysia regarding the purchase of their popular and profitable fast growing infant tree plants.
    Inquiries from the governments of Brazil and Ecuador are also being evaluated.

    Conclusion:

    The examples above show the Awesome, Earning Potential of little
    known Companies That Explode onto Investor�s Radar Screens.
    This stock will not be a Secret for long. Then You May Feel the Desire to Act Right
    Now! And Please Watch This One Trade!!


    GO EGTY!


    All statements made are our express opinion only and should be treated as such.
    We may own, take position and sell any securities mentioned at any time. Any statements that express or involve discussions with respect
    to predictions, goals, expectations, beliefs, plans, projections, objectives, assumptions or future events or performance are
    not statements of historical fact and may be "forward, looking
    statements." forward, looking statements are based on expectations, estimates
    and projections at the time the statements are made that involve a number of risks and uncertainties which could cause actual results
    or events to differ materially from those presently anticipated. This newsletter was paid $3,000 from third party (IR Marketing).
    Forward,|ooking statements in this action may be identified through the use of words such as: "projects", "foresee", "expects". in compliance with Se'ction 17. {b), we disclose the holding of EGTY shares prior to the publication of this report. Be aware of an inherent conflict of interest resulting from such holdings due to our intent to profit from the liquidation of these shares. Shares may be sold at any time, even after positive statements have been made regarding the above company. Since we own shares, there is an inherent conflict of interest in our statements and opinions. Readers of this publication are cautioned not to place undue reliance on forward,looking statements, which are based on certain assumptions and expectations involving various risks and uncertainties that could cause results to
    differ materially from those set forth in the forward- looking statements. This is not solicitation to buy or sell stocks, this text is
    or informational purpose only and you should seek professional advice from registered financial advisor before you do anything related with buying or selling stocks, penny stocks are very high risk and you can lose your entire investment.

     
  • At 10:50 PM , Anonymous Anonymous said...

  • At 3:07 AM , Anonymous Anonymous said...

    Hi!
    You may probably be very interested to know how one can manage to receive high yields on investments.
    There is no initial capital needed.
    You may commense earning with a sum that usually goes
    on daily food, that's 20-100 dollars.
    I have been participating in one company's work for several years,
    and I'm ready to share my secrets at my blog.

    Please visit my pages and send me private message to get the info.

    P.S. I make 1000-2000 per daily now.

    http://theinvestblog.com [url=http://theinvestblog.com]Online Investment Blog[/url]

     

Post a Comment

Subscribe to Post Comments [Atom]

<< Home