Deduplicate on a column fails

3 posts, 1 answers
  1. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 11 May 2015 Link to this post

    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 If
    End 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

  2. Answer
    Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 14 May 2015 Link to this post

    Hello Marc,

    I am experiencing difficulties understanding the problem. As far as I understand the code it looks like it is working correctly. If the ProductMem variable(which seems to be global) contains the value it is expected to receive such an output.

    Could you please elaborate in detail on the exact problem? Additionally can you please share with us the entire page contents(markup and code-behind) so we could examine the implementation.

    Regards,
    Angel Petrov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 27 May 2015 in reply to Angel Petrov Link to this post

    Yes indeed works as expected.

     

    Marc

Back to Top