title: Get Index Given Row and Column
body: <p>Is there a formula that can be used to get the index given the current column and row? The following is what I have so far. The problem is, however, that the code only works for the first row...</p>
  
  <pre><code>for (int i = 0; i &lt; rows; i++)
  {
      for (int j = 0; j &lt; columns; j++)
      {
          index = i * (columns - 1) + j;
      }
  }
  </code></pre>