Skip to content

Highlight the overlap records in the list

rahul ahuja

Asked Jul 30, 2014, 12:27 PM EDT3 answers
Share
LinkedInX
I have list of  ItemFileRecords which contains records like following. I want to find out which records overlap with other record range using LINQ and aslo highlight record which overlap in the grid

SR|File_ID | Item_code | start_page | End_page 
01|1        | 4319         | 1              | 10
02|1        | 4321         | 5              | 9
03|1        | 4321         | 11            | 15
04|1        | 4322         | 14            | 19
05|1        | 4323         | 20            |25
06|1        | 4324         | 26            | 30
07|1        | 4325         | 30            | 35       



SR|File_ID | Item_code | start_page | End_page 
01|1        | 4319         | 1              | 10              (Overlap with rec 2 change color to red)
02|1        | 4321         | 5              | 9                (Overlap with rec 1 change color to red)
03|1        | 4321         | 11            | 15               (Overlap with rec 4 change color to red)
04|1        | 4322         | 14            | 19               (Overlap with rec 3 change color to red)
05|1        | 4323         | 20            |25                        
06|1        | 4324         | 26            | 30                (overlap with rec 7 change color to red)
07|1        | 4325         | 30            | 35               (overlap with rec 6 change color to red)

I have with nested for loop but want to avoid nested for loop, 
If any know any other way to do this can suggest me 

Thanks.       

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    can you provide any reference for PLINQ dont know what is that Thanks
    0
  • -1
    you can try PLINQ for better peformance it's parallel LINQ
    -1
  • -1
    Parallel LINQ -> it's used for parallel processing, faster than LINQ

    syntactically it's similar to LINQ but operates fast.

    Ex- these days, we've dual-core or quad-core CPUs. But are we designing softwares where we're enjoying or making merry using these hardware capabilities. I feel not, we're still following linear development approach.

    So, if we can identify tasks which can be run independently then we can have our CPU work more efficently and we can get our data output fast.

    there are tons of examples of plinq available . so google it...

    twitter @sumitjolly
    -1