How to get an element range in linq within a sequence?

b0ssX

New Member
I have this query to collection:\[code\]Panel thePanel = menuCell.Controls.OfType<Panel>() .Where(panel => panel.Controls.OfType<HyperLink>().Any( label => label.ID == clas)) .FirstOrDefault();\[/code\]This gets only the Panel that has an hyperlink with a certain id. I need to get not only the \[code\]firstOrDefault\[/code\] but the matched element (only the first) and the 2 next within the sequence. I didn't try anything because don't know how.
 
Back
Top