the datagrid does not display in the relative layout see code below
when i change the line Content = relativeLayout; to Content = POGrid the grid displays as it should.
can you tell me where i am going wrong i have doublechecked the references
this is in both android and uwp. i am not using ios
thanks
andrew
i am using visual studio 2017 to code
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
using Syncfusion.SfDataGrid.XForms;
class RelativeLayoutExample : ContentPage
{
SfDataGrid POGrid;
public RelativeLayoutExample()
{
RelativeLayout relativeLayout = new RelativeLayout();
Label upperLeft = new Label { Text = "Supplier", FontSize = 20 };
relativeLayout.Children.Add(upperLeft, Constraint.Constant(10),Constraint.Constant(0));
Entry SName = new Entry { Placeholder = "Name",FontSize=15 };
relativeLayout.Children.Add(SName, Constraint.Constant(5), Constraint.Constant(30), Constraint.Constant(300),null);
Entry SAdd1 = new Entry { Placeholder = "Add1", FontSize = 15 };
relativeLayout.Children.Add(SAdd1, Constraint.Constant(5), Constraint.Constant(65), Constraint.Constant(300), null);
Entry SAdd2 = new Entry { Placeholder = "Add2", FontSize = 15 };
relativeLayout.Children.Add(SAdd2, Constraint.Constant(5), Constraint.Constant(100), Constraint.Constant(300), null);
Entry SAdd3 = new Entry { Placeholder = "Add3", FontSize = 15 };
relativeLayout.Children.Add(SAdd3, Constraint.Constant(5), Constraint.Constant(135), Constraint.Constant(300), null);
Entry SAdd4 = new Entry { Placeholder = "Add4", FontSize = 15 };
relativeLayout.Children.Add(SAdd4, Constraint.Constant(5), Constraint.Constant(170), Constraint.Constant(300), null);
Label LSContact = new Label { Text = "Contact", FontSize = 20 };
relativeLayout.Children.Add(LSContact, Constraint.Constant(5), Constraint.Constant(205));
Entry SContact = new Entry { Placeholder = "Contact", FontSize = 15 };
relativeLayout.Children.Add(SContact, Constraint.Constant(90), Constraint.Constant(205), Constraint.Constant(215), null);
Label LSTel = new Label { Text = "Telephone", FontSize = 20 };
relativeLayout.Children.Add(LSTel, Constraint.Constant(5), Constraint.Constant(240));
Entry STelephone = new Entry { Placeholder = "Telephone", FontSize = 15 };
relativeLayout.Children.Add(STelephone, Constraint.Constant(90), Constraint.Constant(240), Constraint.Constant(215), null);
Label LSFax = new Label { Text = "Fax", FontSize = 20 };
relativeLayout.Children.Add(LSFax, Constraint.Constant(5), Constraint.Constant(275));
Entry SFax = new Entry { Placeholder = "Fax", FontSize = 15 };
relativeLayout.Children.Add(SFax, Constraint.Constant(90), Constraint.Constant(275), Constraint.Constant(215), null);
Label LSEmail = new Label { Text = "Email", FontSize = 20 };
relativeLayout.Children.Add(LSEmail, Constraint.Constant(5), Constraint.Constant(310));
Entry SEmail = new Entry { Placeholder = "Email", FontSize = 15 };
relativeLayout.Children.Add(SEmail, Constraint.Constant(90), Constraint.Constant(310), Constraint.Constant(215), null);
relativeLayout.VerticalOptions= LayoutOptions.FillAndExpand;
relativeLayout.HorizontalOptions= LayoutOptions.FillAndExpand;
OrderInfoRepository viewModel = new OrderInfoRepository();
POGrid = new SfDataGrid();
POGrid.ColumnSizer = ColumnSizer.Star;
POGrid.ItemsSource = viewModel.OrderInfoCollection;
POGrid.VerticalOptions= LayoutOptions.FillAndExpand;
POGrid.HorizontalOptions= LayoutOptions.FillAndExpand;
relativeLayout.Children.Add(POGrid, Constraint.Constant(305), Constraint.Constant(0));
// add more views here
Content = relativeLayout;
}
}