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.
Highlight the overlap records in the list
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
rahul ahuja68 pointsPosted Jul 31, 2014, 11:02 AM EDT
Guest UserRank #258 · 9.8K pointsPosted Jul 31, 2014, 2:40 AM EDT
Guest UserRank #258 · 9.8K pointsPosted Aug 1, 2014, 12:55 AM EDT
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