I encouter a strange behavior when I try to de-duplicate a grid with this code:
Protected Sub dtgProducts_ItemCreated(sender As Object, e As GridItemEventArgs) If (TypeOf (e.Item) Is GridDataItem) Then Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) Response.Write(ProductMem & "-" & item.GetDataKeyValue("ProductCode") & "<br>") If item.GetDataKeyValue("ProductCode") = ProductMem Then 'ontdubbelen voor de zoekfunctie item.Display = False End If ProductMem = item.GetDataKeyValue("ProductCode") End IfEnd Sub
With four data items with ProductCode 106901AS404, the output is:
106901AS404-106901AS404
106901AS404-106901AS404
106901AS404-106901AS404
106901AS404-106901AS404
So how could ProductMem already be set on '106901AS404' in the first loop when no preceding item exists?
Please reply soonest, this is an urgent one...
Thanks,
Marc