Blank Text values - just wondering about this

Discussion in 'ASP .Net Datagrid Control' started by Alex Shirley, Sep 28, 2004.

  1. Alex Shirley

    Alex Shirley Guest

    Hi

    I'm just wondering why the following behavour is happens:

    If I try to get a text value from a datagrid (i.e.
    e.Item.Cells(x).Text), and that value is blank, I will get " "
    instead of a blank value.

    I assume this is behaviour by design? But I wonder why this is the
    case? I'm just trying to get some understanding here. I've written a
    tiny function (below) to get round it, but I'm curious about why this
    value is being returned.

    Cheers

    Alex

    Public Function checkdatagridblank(ByVal thestring As String)
    If thestring <> "&nbsp;" Then
    Return thestring
    Else
    Return ""
    End If
    End Function
     
    Alex Shirley, Sep 28, 2004
    #1
    1. Advertising

  2. Alex,

    My understanding is that some browsers don't handle empty cells well.

    Eliyahu

    "Alex Shirley" <> wrote in message
    news:...
    > Hi
    >
    > I'm just wondering why the following behavour is happens:
    >
    > If I try to get a text value from a datagrid (i.e.
    > e.Item.Cells(x).Text), and that value is blank, I will get "&nbsp;"
    > instead of a blank value.
    >
    > I assume this is behaviour by design? But I wonder why this is the
    > case? I'm just trying to get some understanding here. I've written a
    > tiny function (below) to get round it, but I'm curious about why this
    > value is being returned.
    >
    > Cheers
    >
    > Alex
    >
    > Public Function checkdatagridblank(ByVal thestring As String)
    > If thestring <> "&nbsp;" Then
    > Return thestring
    > Else
    > Return ""
    > End If
    > End Function
     
    Eliyahu Goldin, Sep 28, 2004
    #2
    1. Advertising

  3. some browsers like IE denote a space by indicating
    Non Breaking Space
    n b sp

    as opposed to an empty cell

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
    Got tidbits? Get it here... http://tinyurl.com/27cok
    "Alex Shirley" <> wrote in message
    news:...
    > Hi
    >
    > I'm just wondering why the following behavour is happens:
    >
    > If I try to get a text value from a datagrid (i.e.
    > e.Item.Cells(x).Text), and that value is blank, I will get "&nbsp;"
    > instead of a blank value.
    >
    > I assume this is behaviour by design? But I wonder why this is the
    > case? I'm just trying to get some understanding here. I've written a
    > tiny function (below) to get round it, but I'm curious about why this
    > value is being returned.
    >
    > Cheers
    >
    > Alex
    >
    > Public Function checkdatagridblank(ByVal thestring As String)
    > If thestring <> "&nbsp;" Then
    > Return thestring
    > Else
    > Return ""
    > End If
    > End Function
     
    Alvin Bruney [MVP], Sep 29, 2004
    #3
    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. suresh
    Replies:
    1
    Views:
    367
    Karl Seguin
    Apr 14, 2005
  2. =?Utf-8?B?cm9kY2hhcg==?=

    just wondering

    =?Utf-8?B?cm9kY2hhcg==?=, Oct 21, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    443
    =?Utf-8?B?cm9kY2hhcg==?=
    Oct 22, 2005
  3. =?Utf-8?B?YXJp?=

    just wondering

    =?Utf-8?B?YXJp?=, Oct 22, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    392
    =?Utf-8?B?YXJp?=
    Oct 22, 2005
  4. Morten Aune Lyrstad

    std::vector / std::list - just wondering...

    Morten Aune Lyrstad, Aug 24, 2004, in forum: C++
    Replies:
    2
    Views:
    11,253
    Morten Aune Lyrstad
    Aug 24, 2004
  5. KevinGPO
    Replies:
    2
    Views:
    456
    benben
    Sep 10, 2005
Loading...

Share This Page