I am a fresh learner in C#. I have this code below.I managed to display the data from the property table into their respective text boxes. But I failed to display the filtered propertyunits into the xtraGrid.
private readonly IPropertyService _propertyservice;
private readonly Property _property;
private readonly IPropertyUnitService _propertyUnitService;
private readonly PropertyUnit _propertyUnit;
public frmEditLandlordProperty() {
InitializeComponent();
_propertyservice = UnityConfig.GetContainer().Resolve<IPropertyService>();
_propertyUnitService = UnityConfig.GetContainer().Resolve<IPropertyUnitService>();
}
public frmEditLandlordProperty(int PropertyId)
: this(){
this._property = _propertyservice.GetById(PropertyId);
this._propertyUnit = _propertyUnitService.GetById(PropertyId);
}
private void frmEditLandlordProperty_Load(object sender, EventArgs e) {
propertyBindingSource.DataSource = _property;
propertyUnitsBindingSource.DataSource = _propertyUnit;
}