title: using Adapter to display ListView Mono for android
body: <p>I created a <code>ListView</code> and to populate it I'm using <code>Adapter</code>. </p>
  
  <p><code>GetView()</code> of <code>Adapter</code> class is as follows:</p>
  
  <pre><code>LayoutInflater inflater = activity.LayoutInflater;
  if (convertView == null) 
  {
      convertView = inflater.Inflate(Resource.Layout.List_MktData, null);
  }
  
  DataRow dr;
  object[] row;
  
  if(position==0)
  {
      Console.WriteLine("In position 0");
      dr = result.Rows[0];
      row=dr.ItemArray;
  
      tvCMPValue.Text=row[0].ToString();
      tvPrevClose.Text=row[1].ToString();
      tvOpen.Text=row[2].ToString();
      tvHigh.Text=row[3].ToString();
      tvLow.Text=row[4].ToString();
      tvClose.Text=row[5].ToString();
  }
  
  else if(position==1)
  {
      Console.WriteLine("In position 1");
      dr = result.Rows[1];
      row=dr.ItemArray;
  
      tvPercChgValue.Text=row[0].ToString();
      tvPrevCloseValue.Text=row[1].ToString();
      tvOpenValue.Text=row[2].ToString();
      tvHighValue.Text=row[3].ToString();
      tvLowValue.Text=row[4].ToString();
      tvCloseValue.Text=row[5].ToString();
  }
  </code></pre>
  
  <p>where all elements starting with <strong>tv</strong> are <code>TextView</code> within a <code>ListView</code>.</p>
  
  <p>Now the problem is when I run this code, I get the following output as shown in Screen shot.</p>
  
  <p>i.e. Content of <code>Row1</code> and <code>Row2</code> gets displayed in <code>Row1' while</code>Row2` is showing correct data.</p>
  
  <p>I know it is something related with <code>position</code> variable, but after spending lot of time on it, I'm still not able to crack it.</p>
  
  <p>Note : Data is coming from <code>DataTable</code> having two rows.</p>
  
  <p>1st row of <code>ListView</code> should be populated with 1st row of <code>DataTable</code> while 2nd row of <code>ListView</code> should be populated with 2nd row of <code>DataTable</code>.</p>
  
  <p>I'm absolute beginner when it comes to <em>Mono for Android</em>, so any help appreciated...</p>
  
  <p><img src="https://i.imgur.com/ulOHf.png" alt="screen shot"></p>