Create RelativeLayout + childres via Xamarin.Android code

Hello, I'm working on a project I'm working on, but I'm not sure what to do with it. all bugged should be below rsrs this way, but the product name under the img and i wrap the rigth = "id" but not even a left edge is applied find an error from me.
Picture as it should

            LayoutParams lp = new LayoutParams (LayoutParams.MatchParent, 150);
lp.Gravitation = GravityFlags.Links;
lp.LeftMargin = 250;


LayoutParams lp2 = new LayoutParams (130, 130);
lp2.Gravitation = GravityFlags.Left;


LayoutParams lp3 = new LayoutParams (LayoutParams.WrapContent, LayoutParams.WrapContent);
lp3.Gravity = GravityFlags.Center;
lp3.LeftMargin = 12;


// list list = data2 ();
// OpensConnection ();
line.RemoveAllViews ();
while (a! = dt.Rows.Count)
{
// real layout
var relative = new RelativeLayout (this)
{
Id = int.Parse ("10" + dt.Rows.)[a]["codigo"].ToString ()),
};
relative.SetBackgroundResource (Resource.Drawable.backline);

// product image
Button myButton = new button (this);
myButton.Gravity = GravityFlags.Left;
myButton.LayoutParameters = lp2;
//myButton.TranslationX = -52;
//myButton.TextAlignment = TextAlignment.Center;
//myButton.SetTextColor(Android.Graphics.Color.White);
//myButton.SetTextSize(Android.Util.ComplexUnitType.Dip,24);
//myButton.SetBackgroundResource(2130837599);
if (dt.Rows[a]["img"].ToString ()! = "")
{
byte[] data0 = (byte[]dt.Rows[a]["img"];
MemoryStream ms0 = new MemoryStream (data0);
myButton.SetBackgroundDrawable (Android.Graphics.Drawables.Drawable.CreateFromStream (ms0, "category"));
}
//myButton.Text = dt.Rows[a]["nome"], ToString ();
myButton.Id = int.Parse (dt.Rows[a]["codigo"], ToString ());
myButton.Click + = myButon_cliki;
//myButton.id


// Text with the product name
TextView txtprod = new TextView (this)
{
Right = int.Parse (dt.Rows[a]["codigo"].ToString ()), Gravity = GravityFlags.Center

};

txtprod.TextSize = 24f;
txtprod.SetTextColor (Android.Graphics.Color.Black);
//txtprod.LayoutParameters = lp3;

txtprod.Text = dt.Rows[a]["nome"], ToString ();
relative.SetGravity (GravityFlags.Center);
relative.AddView (txtprod);
relative.AddView (myButton);
relative.LayoutParameters = lp;

line.AddView (relative);

This line is a linear layout

If someone can help me, I'm grateful <3