Initialize collection in constructor of Sample class otherwise binding will fail at time of load and it won't work until you manually raise PropertyChanged
event for ModelCollection.
Either:
public Sample()
{
ModelCollection = new ObservableCollection<SchoolModel>();
}
OR
Implement INPC
on Sample class as well and raise PropertyChanged
event after initialization logic in GridMethod()
.
public void GridMethod()
{
ModelCollection = new ObservableCollection<SchoolModel>();
ModelCollection.Add(new SchoolModel() {Id=1, Name="ABC" });
ModelCollection.Add(new SchoolModel() { Id = 2, Name = "PQR" });
ModelCollection.Add(new SchoolModel() { Id = 3, Name = "DEF" });
OnPropertyChanged("ModelCollection");
}