OnItemDatabound requires Item or AlternatingItem and Item?

Discussion in 'ASP .Net Datagrid Control' started by kidpurple, Nov 2, 2004.

  1. kidpurple

    kidpurple Guest

    This took me a while to figure out:

    I have 2 datagrids on the same webform, they are very similar, but of
    course have different names, datasources, and OnItemDataBound
    handlers. I am attaching a javascript confirm onto a delete button in
    each datagrid. the first one worked fine, but the second one only
    attached the confirm on every other item.

    So I finally fixed that and my OnItemDataBound handlers look like this
    now:

    dg1:
    if (e.Item.ItemType == ListItemType.Item) .....

    dg2:
    if (e.Item.ItemType == ListItemType.Item | e.Item.ItemType ==
    ListItemType.AlternatingItem) .....

    So how does one work with just looking for ListItemType.Item, while
    the other needed both Item and AlternatingItem? Makes me curious.....

    Thanks,
    kp
     
    kidpurple, Nov 2, 2004
    #1
    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. Beffmans

    AlternatingItem Style in asp:table

    Beffmans, Jul 20, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    443
    =?Utf-8?B?U2l2YSBN?=
    Jul 20, 2005
  2. DebonairDC

    AlternatingItem without repeating code

    DebonairDC, Nov 11, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    351
    DebonairDC
    Nov 11, 2005
  3. ibiza
    Replies:
    2
    Views:
    5,686
    ibiza
    Feb 1, 2006
  4. bpd
    Replies:
    0
    Views:
    808
  5. K Viltersten
    Replies:
    6
    Views:
    417
    Nathan Sokalski
    Oct 5, 2009
Loading...

Share This Page