title: Converting index of one dimensional array into two dimensional array i. e. row and column
body: <p>I have one application of <code>WinForms</code> which inside list box I am inserting name and price..name and price are stored in two dimensional array respectively. Now when I select one record from the <code>listbox</code> it gives me only one index from which I can get the string name and price to update that record I have to change name and price at that index for this I want to update both two dimensional array name and price. but the selected index is only one dimensional. I want to convert that index into row and column. How to do that?</p>
  
  <p>But I'm inserting record in list box like this.</p>
  
  <pre><code>int row = 6, column = 10;
  for(int i=0;i&lt;row;i++)
  {
      for(int j=0;j&lt;column;j++)
      {
          value= row+" \t "+ column +" \t "+ name[i, j]+" \t " +price[i, j];
          listbox.items.add(value);
      }
  }
  </code></pre>