conditional formating on Datagrid control

Discussion in 'ASP .Net Datagrid Control' started by Harley, Jul 29, 2003.

  1. Harley

    Harley Guest

    i have a databound datagrid control. one of the bound columns displays a
    date.
    i need to display it in red if it is 2 or less days from the current date,
    and leave it with the default color if not.
    any idea?
    Harley, Jul 29, 2003
    #1
    1. Advertising

  2. Harley

    John Guest

    Add a column to the underlying datatable, call it displayDate, then before
    binding, iterate through the rows of the table checking the value in the
    column RealDate and based on that set the value in displayDate to be

    "[font color=red (or black for normal
    dates)>"+RealDate.ToString()+"[/font>";

    Then, set the RealDate bound column invisible, and the displaydate column
    visible.

    "[" used instead of left carat above to prevent some mail readers from
    going nuts.

    John
    http://mallsocket.com


    "Harley" <harleyobrien%40hotmail.com> wrote in message
    news:e7Vso#...
    > i have a databound datagrid control. one of the bound columns displays a
    > date.
    > i need to display it in red if it is 2 or less days from the current date,
    > and leave it with the default color if not.
    > any idea?
    >
    >
    John, Jul 30, 2003
    #2
    1. Advertising

  3. Check out this article..

    http://www.netomatix.com/GridFormatting.aspx


    --
    Naveen K Kohli
    http://www.netomatix.com
    "Harley" <harleyobrien%40hotmail.com> wrote in message
    news:e7Vso%...
    > i have a databound datagrid control. one of the bound columns displays a
    > date.
    > i need to display it in red if it is 2 or less days from the current date,
    > and leave it with the default color if not.
    > any idea?
    >
    >
    Naveen K Kohli, Jul 30, 2003
    #3
  4. Harley

    Saravana Guest

    Check out these article,
    http://msdn.microsoft.com/library/en-us/dv_vstechart/html/vbtchTopQuestionsA
    boutASPNETDataGridServerControl.asp?frame=true#vbtchtopquestionsaboutaspnetd
    atagridservercontroleditingmultiplerows

    or
    http://www.microsoft.com/india/msdn/articles/SolutionstoTopFourQuestions.asp
    x
    --
    Saravana
    Microsoft India Community Star,MC**
    www.ExtremeExperts.com



    "Harley" <harleyobrien%40hotmail.com> wrote in message
    news:e7Vso#...
    > i have a databound datagrid control. one of the bound columns displays a
    > date.
    > i need to display it in red if it is 2 or less days from the current date,
    > and leave it with the default color if not.
    > any idea?
    >
    >
    Saravana, Jul 31, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VGF5bw==?=

    Datagrid formating

    =?Utf-8?B?VGF5bw==?=, May 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,424
    Raterus
    May 24, 2004
  2. Tina

    Runtime DataGrid formating

    Tina, Dec 21, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,343
  3. Alec S.
    Replies:
    10
    Views:
    10,091
    Alec S.
    Apr 16, 2005
  4. Formating DataGrid/View

    , Feb 22, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    384
  5. Willem

    Conditional formating

    Willem, Nov 27, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    110
    Nuno Fonseca
    Nov 29, 2004
Loading...

Share This Page