SfPopupLayout sfPopup;
SfDataGrid sfdatagrid;
DataTemplate template;
bool isopening = false;
public MainPage()
{
InitializeComponent();
sfPopup = new SfPopupLayout();
sfdatagrid = new SfDataGrid();
isopening = true;
sfdatagrid.ColumnSizer = ColumnSizer.Auto;
sfdatagrid.AutoGenerateColumns = false;
sfdatagrid.ItemsSource = viewModel.OrdersInfo;
sfPopup.PopupView.ShowFooter = false;
sfPopup.PopupView.AnimationMode = AnimationMode.Zoom;
sfPopup.PopupView.HeaderTitle = "Lista de Expedientes";
sfPopup.PopupView.AutoSizeMode = AutoSizeMode.Both;
sfPopup.Opening += SfPopup_Opening;
StackLayout stackLayout = new StackLayout();
Label label = new Label();
label.Text = "Label";
GridTextColumn gridTextColumn = new GridTextColumn();
gridTextColumn.MappingName = "OrderID";
sfdatagrid.Columns.Add(gridTextColumn);
GridTextColumn gridTextColumn2 = new GridTextColumn();
gridTextColumn2.MappingName = "EmployeeID";
sfdatagrid.Columns.Add(gridTextColumn2);
GridTextColumn gridTextColumn3 = new GridTextColumn();
gridTextColumn3.MappingName = "CustomerID";
sfdatagrid.Columns.Add(gridTextColumn3);
GridTextColumn gridTextColumn4 = new GridTextColumn();
gridTextColumn4.MappingName = "FirstName";
sfdatagrid.Columns.Add(gridTextColumn4);
GridTextColumn gridTextColumn5 = new GridTextColumn();
gridTextColumn5.MappingName = "LastName";
sfdatagrid.Columns.Add(gridTextColumn5);
stackLayout.Children.Add(label);
stackLayout.Children.Add(sfdatagrid);
sfPopup.PopupView.ContentTemplate = new DataTemplate(() => {
return stackLayout;
});
}
private void SfPopup_Opening(object sender, Syncfusion.XForms.Core.CancelEventArgs e)
{
if (isopening)
{
sfPopup.PopupView.Refresh();
}
isopening = false;
}
private void Button_Clicked_2(object sender, EventArgs e)
{
sfPopup.Show();
}
} |