Accessing BusinessBindingSource Data


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I am using a Devexpress grid with a BusinessBindingSource as the Source of the data linked to a SF BO. Most of the time this works fine. However, when I delete a Row, and I want to view an 'Unbound' field, I am getting errors. In Devexpress terms, an Unbound Field is where the Value is not directly in the table, but a Piece of Code is run to return the field. This code is put into a 'CustomUnboundColumndata' event .

When I run similar code, using a Bog Standard Windows BindingSource as the Data Source, data is returned fine, so I am assuming I am not taking care of some differences betwee the Windows BindingSource and the SF BuisnessBindingSource.

The code below runs fine using a Windows Binding Source , but when using te SF BusinessBidingSource, Null gets into the rowView, and so an error is thrown

private void gridView1_CustomUnboundColumnData(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDataEventArgs e)

        {

           GridView view = sender as GridView;

           if (e.Column.FieldName == "Unbound" && e.IsGetData)

           {

               IList source = view.DataSource as IList;

               DataRowView rowView =source[e.ListSourceRowIndex] as DataRowView;

               e.Value = rowView["FirstName"]+ "Test";

           }

        }

 

Anybody doing something similar with Devex (i.e. running CustomeUnboundColumnData event), or know how to amend the above in a SF BusinessBindingSource scenario


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