and null fields in a datagrid

Discussion in 'ASP .Net Datagrid Control' started by Tina, Oct 18, 2005.

  1. Tina

    Tina Guest

    in the itemDatabound event of a datagrid, both null fields and blank string
    come through as   in the e.items.cells field. Is there anyway to tell
    them apart?
    Thanks,
    T
    Tina, Oct 18, 2005
    #1
    1. Advertising

  2. Is there anything specific you're trying to accomplish by differentiating
    between the two? Under general scenarios, they would both be the same in
    the datagrid. But if you're looking to change the value in the datagrid
    based upon these values, you should check the corresponding value in the
    dataset, and not in the datagrid cell. You can access it in the
    ItemDataBound event with something like

    ds.Tables(0).Rows(e.Item.ItemIndex)

    HTH

    -Altaf [MVP]
    --------------------------------------------------------------------------------
    All that glitters has a high refractive index.
    www.mendhak.com


    "Tina" <> wrote in message
    news:...
    > in the itemDatabound event of a datagrid, both null fields and blank
    > string
    > come through as &nbsp; in the e.items.cells field. Is there anyway to
    > tell
    > them apart?
    > Thanks,
    > T
    >
    >
    S.M. Altaf [MVP], Oct 19, 2005
    #2
    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?Q2FsdmluIEtE?=

    How to display blank instead of &nbsp; in BoundColumn if null

    =?Utf-8?B?Q2FsdmluIEtE?=, Jul 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,661
    =?Utf-8?B?bG9uZG9uIGNhbGxpbmc=?=
    Jul 8, 2005
  2. Tina

    &nbsp; and null fields

    Tina, Oct 18, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    741
    Mythran
    Oct 19, 2005
  3. Robert Kattke
    Replies:
    0
    Views:
    427
    Robert Kattke
    Dec 31, 2003
  4. Douglas J. Badin

    &nbsp; is not generated for null values when using a format string

    Douglas J. Badin, Dec 2, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    194
    Jeffrey Tan[MSFT]
    Dec 4, 2003
  5. hotkitty

    Parsing CSV and "&nbsp;&nbsp;"

    hotkitty, Oct 9, 2008, in forum: Perl Misc
    Replies:
    9
    Views:
    322
Loading...

Share This Page