0

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;

}
2
Contributors
1
Reply
28
Views
3 Years
Discussion Span
Last Post by AleMonteiro
0

Just a guess, but aren't you missing .DataBind()?

   propertyBindingSource.DataSource = _property;
   propertyBindingSource.DataBind();

   propertyUnitsBindingSource.DataSource = _propertyUnit;
   propertyUnitsBindingSource.DataBind();
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.