Bar chart with datagrid

Posted on 2005-04-15
Last Modified: 2010-04-07

I need to represent data by a graphic bar in a datagrid, someone know how to do this??


|Computers | 100 | XXXXXXXXX                     |
|Printers      | 50  | XXXXX                             |
Of course I don't want Xs but a real colored bar.

Question by:mbernierhq
    LVL 3

    Expert Comment

    LVL 11

    Expert Comment

    Make a template column for your bar.

    - add an image tag in the template column (with a small bar with a size of 2 pixels) etc.

    - adjust its width according to your calculation inside the ItemDataBound event handler.

    should be simple enough.




    Author Comment

    I don't want to put code in HTML, I want all code in the codebehind page. I'm using VB with  ASP.NET.
    I also need it to be inside the datagrid not a graphic by itself.
    LVL 11

    Accepted Solution

    You just put the image control on the page and code it from code-behind.

    You put it INSIDE a template column of a DATAGRID.



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 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

    9 Experts available now in Live!

    Get 1:1 Help Now