K
kidpurple
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
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