title: WPF : Dynamically create a grid with specified x rows and y columns with static image in each cell
body: <p><strong>Question:</strong>
  I am new to WPF and i am not able to figure out this.
  How do i create a grid with x rows and y columns and insert image into each cell at run time ?</p>
  <p><strong>Scenario:</strong>
  I have an inventory project where the end user will search for a item and the application will specify where he can find the item. Now i am already retrieving the cabinet details where the items are kept which again have a rack of x rows and y columns . The rack being displayed  can have different row or column sizes.See Image.</p>
  <p><strong>Approach:</strong>
  So what i figured out is that i should have a grid of x rows and y columns (known only at run time). Fill an image for each cell value. Insert a different image into the location of the item or highlight that cell value. But i am not able to find how to do that. Most of my searches point to add rows and columns  dynamically. Am i missing something very obvious?</p>
  <p><strong>Expected Output:</strong>
  Given below is how i would like it to be displayed to my end user :
  <img src="https://i.stack.imgur.com/AYvDK.png" alt="Preview" /></p>