BusinessBindingSource and XtraGrid


Author
Message
Chan
Chan
Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

At the beginning, I declared custom property and bind grid column to this property. However, it cause problem in new item row. The first character always not recognized and will be removed. DevExpress recommend me to use other approach.
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Chan,

Is there any reason you cannot just create a custom property on the BO so that it is recognized like any other BO strong-typed field property?

Chan
Chan
Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)Advanced StrataFrame User (701 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
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.

}

}

}

}





GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search