Hi,
I am using BusinessBindingSource to bind SF BO to DevExpress XtraGrid. I would like to dislay custom column value which recommended by DevExpress team. I have the code below in CustomUnboundColumnData event. The value of my unbound column show the same for all rows. I suspect the record point of purchaseInvoiceDetails always at the same row while I refer it in this event. I added Navigate(BusinessNavigationDirection.Absolute, e.ListSourceRowIndex) to navigate to corresponding row to get correct value. It works, however, don't know why the last few rows in xtragrid would be highlighted. When I try to navigate to other row it would hit error "Index out of bound".
Any ideas? Does BusinessBindSource synchronize record point with SF BO while displaying records?
Thank you
private void grdPInvoiceDetailsView_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)
{
if (e.Column.FieldName == "colItemCode")
{
if (e.IsGetData)
{
purchaseInvoiceDetailsBO.Navigate(e.)
e.Value = purchaseInvoiceDetailsBO.ItemCode;
}
else if (e.IsSetData)
{
itemsBO.FillByItemCodeOrBarcode(e.Value as string);
if (itemsBO.Count > 0)
{
e.Value = itemsBO.ItemCode;
purchaseInvoiceDetailsBO.ItemID = itemsBO.ItemID;
}
else
{
//e.Column.ColumnEdit.
}
}
}
}