ItemDataBound issue

Discussion in 'ASP .Net' started by Wayne Carlaw, Jul 7, 2004.

  1. Wayne Carlaw

    Wayne Carlaw Guest

    Why does the e.Item.Cells[3].Text value always return empty? Without this
    routine (or if I comment out the guts), the text exists.

    private void dg_ItemDataBound(Object sender, DataGridItemEventArgs e) {

    if((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType ==
    ListItemType.AlternatingItem)) {

    string item = e.Item.Cells[3].Text;
    e.Item.Cells[3].Text = item;

    }

    }

    Thanks.
    Wayne Carlaw, Jul 7, 2004
    #1
    1. Advertising

  2. Wayne Carlaw

    Guest

    On Wed, 7 Jul 2004 11:45:30 -0400, "Wayne Carlaw" <>
    wrote:

    >Why does the e.Item.Cells[3].Text value always return empty? Without this
    >routine (or if I comment out the guts), the text exists.
    >
    > private void dg_ItemDataBound(Object sender, DataGridItemEventArgs e) {
    >
    > if((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType ==
    >ListItemType.AlternatingItem)) {
    >
    > string item = e.Item.Cells[3].Text;
    > e.Item.Cells[3].Text = item;
    >
    > }
    >
    > }
    >
    >Thanks.
    >


    Check to see what is actually in the cell. Iterate over the Controls
    collection in the cell. I find that sometimes The text might get
    cautght up in a literal control item.

    -Adam
    , Jul 7, 2004
    #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. James G. Beldock

    ItemDataBound not received by grid in table?

    James G. Beldock, Jul 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    427
    James G. Beldock
    Jul 24, 2003
  2. Tina
    Replies:
    1
    Views:
    365
    Suresh
    Oct 14, 2003
  3. René Paschold

    Re: ItemDataBound in Repeater: FYI

    René Paschold, Oct 14, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    400
    René Paschold
    Oct 16, 2003
  4. Steve Klett

    inserting control in ItemDataBound

    Steve Klett, Nov 12, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    604
    Steve Klett
    Nov 13, 2003
  5. Peter Afonin
    Replies:
    2
    Views:
    444
    Peter Afonin
    Nov 19, 2003
Loading...

Share This Page