|
public sealed class MainActivity : Activity
{
SfDataGrid dataGrid;
SfDataGrid dataGridSent;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);
LinearLayout layoutcontent = FindViewById<LinearLayout>(Resource.Id.linearcontent);
RelativeLayout Relative = FindViewById<RelativeLayout>(Resource.Id.Relative);
RelativeLayout RelativeSent = FindViewById<RelativeLayout>(Resource.Id.RelativeSent);
TextView barcode = FindViewById<TextView>(Resource.Id.barcode);
TextView barcodeSent = FindViewById<TextView>(Resource.Id.barcodeSent);
Button sendData = FindViewById<Button>(Resource.Id.getData);
Button sendDataSent = FindViewById<Button>(Resource.Id.getDataSent);
// Set our view from the "main" layout resource
dataGrid = new SfDataGrid(this);
dataGridSent = new SfDataGrid(this);
OrderInfoRepository viewmodel = new OrderInfoRepository();
dataGrid.ItemsSource = viewmodel.OrderInfoCollection;
dataGrid.AutoGenerateColumns = false;
GridTextColumn orderIDColumn = new GridTextColumn() { MappingName = "OrderID"};
dataGrid.Columns.Add(orderIDColumn);
GridTextColumn shipCityColumn = new GridTextColumn() { MappingName = "ShipCity" };
dataGrid.Columns.Add(shipCityColumn);
GridTextColumn shipCountryColumn = new GridTextColumn() { MappingName = "ShipCountry"};
dataGrid.Columns.Add(shipCountryColumn);
dataGrid.ColumnSizer = ColumnSizer.Star;
dataGridSent.ItemsSource = viewmodel.OrderInfoCollection;
GridTextColumn orderIDColumnmatch = new GridTextColumn() { MappingName = "OrderID" };
dataGridSent.Columns.Add(orderIDColumnmatch);
GridTextColumn customerIDColumn = new GridTextColumn() { MappingName = "CustomerID" };
dataGridSent.Columns.Add(customerIDColumn);
GridTextColumn CustomerColumn = new GridTextColumn() { MappingName = "Customer" };
dataGridSent.Columns.Add(CustomerColumn);
dataGridSent.AutoGenerateColumns = false;
dataGridSent.ColumnSizer = ColumnSizer.Star;
Relative.AddView(dataGrid, 1050, 500);
RelativeSent.AddView(dataGridSent, 1050, 500);
}
}
|