title: C# Sort a list from the values of another list
body: <p>hoping you can help me with this.</p>
  
  <p>Okay I have two lists.</p>
  
  <p>List1 - Gets the names of files without a path (so I can list the names on dynamically created buttons). More so for visual purposes only.</p>
  
  <p>List2 - Stores the actual path to the file.</p>
  
  <p>Now I have done List1.Sort(); and List2.Sort().
  But being they are alphabetical, A direct path from C:/// is different than Hello.png. &lt;(Just an example name)></p>
  
  <p>So the problem I am facing is, List1 and 2 aren't identical in where the actual elements are stored. (Which does make sense).</p>
  
  <p>So is there a way to like sort List2 to match the same order as List1? Or vice versa.. So when I click the button, it loads the proper image,etc that it needs to.</p>