title: Not maintaining the position when scroll up in gridview
body: <p>I created a gridview adapter that will view the image and text. It works fine but when I scroll up, the position is not align. But when I scroll down, the align position is work perfectly.</p>
  
  <p>This is the picture when I scroll up:</p>
  
  <p><a href="https://i.stack.imgur.com/ogoE7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ogoE7.png" alt="This is the picture when I scroll up"></a></p>
  
  <p>Here is my code:</p>
  
  <p>gridview_layout.axml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:gravity="center_horizontal"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
    &lt;ImageView
      android:layout_width="100dp"
      android:layout_height="100dp"
      android:layout_marginTop="15dp"
      android:id="@+id/imageViewGrid"/&gt;
    &lt;TextView
      android:layout_marginTop="5dp"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/textViewGrid"/&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <hr>
  
  <p>fragment_layout.axml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:orientation="vertical"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
      &lt;RelativeLayout
          android:padding="16dp"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"&gt;
          &lt;GridView
              android:id="@+id/grid_view_image_text"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:columnWidth="110dp"
              android:gravity="center"
              android:numColumns="auto_fit" /&gt;
      &lt;/RelativeLayout&gt;
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"
          android:layout_gravity="center" /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <hr>
  
  <p>CustomeGridViewAdapter.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Net;
  using System.Text;
  using System.Threading.Tasks;
  using Android.App;
  using Android.Content;
  using Android.OS;
  using Android.Runtime;
  using Android.Views;
  using Android.Widget;
  using Java.Lang;
  using Square.Picasso;
  
  
  namespace testing_code
  {
      public class CustomGridViewAdapter : BaseAdapter
      {
          private Context context;
          private string[] gridViewString;
  
  
          private string[] gridViewImage;
          public CustomGridViewAdapter(Context context, string[] gridViewstr, string[] gridViewImage )
          {
              this.context = context;
              gridViewString = gridViewstr;
              this.gridViewImage = gridViewImage;
          }
          public override int Count
          {
              get
              {
                  return gridViewString.Length;
              }
          }
  
          public override Java.Lang.Object GetItem(int position)
          {
              return null;
          }
  
          public override long GetItemId(int position)
          {
              return 0;
          }
  
          public override View GetView(int position, View convertView, ViewGroup parent)
          {
              View view;
  
              LayoutInflater inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService);
              if(convertView == null)
              {
                  view = new View(context);
                  view = inflater.Inflate(Resource.Layout.gridview_layout, null);
                  TextView txtview = view.FindViewById&lt;TextView&gt;(Resource.Id.textViewGrid);
                  ImageView imgview = view.FindViewById&lt;ImageView&gt;(Resource.Id.imageViewGrid);
  
                  txtview.Text = gridViewString[position];
  
                  Picasso.With(context)
         .Load((gridViewImage[position]))
         .Into(imgview);
              }
              else
              {
  
                  view = (View)convertView;
  
              }
              return view;
          }
  
  
      }
  }
  </code></pre>
  
  <hr>
  
  <p>Fragment1.cs</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using Android.App;
  using Android.Content;
  using Android.OS;
  using Android.Runtime;
  using Android.Util;
  using Android.Views;
  using Android.Widget;
  using SupportFragment = Android.Support.V4.App.Fragment;
  using Android.Support.Design.Widget;
  using Android.Support.V7.App;
  using Android.Support.V4.Widget;
  using Android.Support.V4.App;
  using MySql.Data.MySqlClient;
  using System.Data;
  
  namespace testing_code
  {
      public class Fragment1 : SupportFragment
      {
          MySqlConnection conn = new MySqlConnection();
  
          string query = "server=sample.com;port=3306;database=db_sample;user id=root;password=123";
  
          GridView gridview;
          List&lt;string&gt; gridviewstring = new List&lt;string&gt;();
          List&lt;string&gt; imgview = new List&lt;string&gt;();
  
          public override void OnCreate(Bundle savedInstanceState)
          {
              base.OnCreate(savedInstanceState);
  
              // Create your fragment here
          }
  
          public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
          {
              // Use this to return your custom view for this Fragment
              // return inflater.Inflate(Resource.Layout.YourFragment, container, false);
  
              View view = inflater.Inflate(Resource.Layout.fragment_layout, container, false);
  
  
              conn.ConnectionString = query;
  
              MySqlCommand cmd = new MySqlCommand("Select * from wp_mobile_product", conn);
  
  
              try
              {
                  conn.Open();
                  MySqlDataReader reader = cmd.ExecuteReader();
  
  
                  while (reader.Read())
                  {
  
                      string get_id = reader["product_title"].ToString();
                      string get_img = reader["product_image"].ToString();
  
  
                      gridviewstring.Add(get_id);
                      imgview.Add(get_img);
                  }
              }
              catch (MySqlException ex)
              {
                  Android.Support.V7.App.AlertDialog.Builder except = new Android.Support.V7.App.AlertDialog.Builder(Activity);
                  except.SetTitle("Please report this to our website(error server timeout)");
                  except.SetMessage(ex.ToString());
                  except.SetPositiveButton("Ok", (senderAlert, args) =&gt;
                  {
                      except.Dispose();
                  });
                  except.Show();
              }
              finally
              {
                  conn.Close();
              }
  
  
              string[] GridViewStringArray = gridviewstring.ToArray();
              string[] GridImgViewArray = imgview.ToArray();
              CustomGridViewAdapter adapter = new CustomGridViewAdapter(Activity, GridViewStringArray, GridImgViewArray);
  
              gridview = view.FindViewById&lt;GridView&gt;(Resource.Id.grid_view_image_text);
              gridview.Adapter = adapter;
  
              return view;
          }
  
      }
  }
  </code></pre>