DataGrid - Formatting a specific row

Discussion in 'ASP .Net' started by David Freeman, Oct 23, 2004.

  1. Hi There!

    Is there any way I can format a specific row?

    For example, I want to format the row where customer name is "David" with
    yellow background, or bold the text.

    How do I accomplish this using DataGrid??

    Thanks all in advance!!!
    David
     
    David Freeman, Oct 23, 2004
    #1
    1. Advertising

  2. ....

    "David Freeman" <> wrote in message
    news:...
    > Hi There!
    >
    > Is there any way I can format a specific row?
    >
    > For example, I want to format the row where customer name is "David" with
    > yellow background, or bold the text.
    >
    > How do I accomplish this using DataGrid??
    >
    > Thanks all in advance!!!
    > David
    >
     
    David Freeman, Oct 23, 2004
    #2
    1. Advertising

  3. David Freeman

    Scott Allen Guest

    You can capture the ItemDataBound event, inspect the value and set the
    DataGridItem object's BackColor property (e.Item.BackColor = ...;

    DinoE does all sorts of stunts like this in an article with code:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndive/html/data01102002.asp

    HTH,

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Sun, 24 Oct 2004 01:10:10 +1300, "David Freeman"
    <> wrote:

    >...
    >
    >"David Freeman" <> wrote in message
    >news:...
    >> Hi There!
    >>
    >> Is there any way I can format a specific row?
    >>
    >> For example, I want to format the row where customer name is "David" with
    >> yellow background, or bold the text.
    >>
    >> How do I accomplish this using DataGrid??
    >>
    >> Thanks all in advance!!!
    >> David
    >>

    >
     
    Scott Allen, Oct 23, 2004
    #3
  4. David Freeman

    Karl Guest

    Dino's article is win!!

    I'm not done my own on DataBinding, but you can see it here:
    http://openmymind.net/databinding/index.html , take a look at the Formatting
    and OnItemDataBound sections which should be what you are looking for.

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Scott Allen" <bitmask@[nospam].fred.net> wrote in message
    news:...
    > You can capture the ItemDataBound event, inspect the value and set the
    > DataGridItem object's BackColor property (e.Item.BackColor = ...;
    >
    > DinoE does all sorts of stunts like this in an article with code:
    >

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndive/html/data01102002.asp
    >
    > HTH,
    >
    > --
    > Scott
    > http://www.OdeToCode.com/blogs/scott/
    >
    > On Sun, 24 Oct 2004 01:10:10 +1300, "David Freeman"
    > <> wrote:
    >
    > >...
    > >
    > >"David Freeman" <> wrote in message
    > >news:...
    > >> Hi There!
    > >>
    > >> Is there any way I can format a specific row?
    > >>
    > >> For example, I want to format the row where customer name is "David"

    with
    > >> yellow background, or bold the text.
    > >>
    > >> How do I accomplish this using DataGrid??
    > >>
    > >> Thanks all in advance!!!
    > >> David
    > >>

    > >

    >
     
    Karl, Oct 23, 2004
    #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?S2F0aWU=?=

    DataGrid row formatting

    =?Utf-8?B?S2F0aWU=?=, Feb 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,188
    Marshal Antony
    Feb 21, 2004
  2. Craig
    Replies:
    2
    Views:
    2,878
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Nov 2, 2004
  3. Donal McWeeney

    DataGrid custom item/row formatting

    Donal McWeeney, Sep 24, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    124
    Donal McWeeney
    Sep 24, 2003
  4. D
    Replies:
    0
    Views:
    219
  5. Giggle Girl

    ie6 Insert Row at specific Row Index of Table

    Giggle Girl, Feb 5, 2006, in forum: Javascript
    Replies:
    18
    Views:
    280
    Thomas 'PointedEars' Lahn
    Feb 7, 2006
Loading...

Share This Page