StrataFrame Forum

Using WebBusinessBindingSource with DevExpress 8.1.1 ASPxGridView

http://forum.strataframe.net/Topic17221.aspx

By Mark Dowlearn - 6/21/2008

Hello,



I'm doing a test web page with a DevExpress 8.1.1 ASPxGridView and a WebBusinessBindingSource.



I've linked the WebBusinessBindingSource to a SF BO that represents a SQL2005 table. It has some custom properties on it but aside from that is a straight mapping of the table.



I've set the data source for the grid to the WebBusinessBindingSource. (The grid doesn't appear to like the custom properties, so I've just loaded a couple of varchar fields as columns and under those conditions it appears to work ok for setting up the columns and displaying them).



I populate the WebBusinessBindingSource's underlying BO in the PageLoad method of the page.



When I run the page, the BO seems to properly populate with about 140 records, but the grid displays just the first row and then repeats the first row for all the remaining rows that it displays.



I'm able to get all rows to display when using a SqlDataSource, so I am thinking this has something to do with the WebBusinessBindingSource.



It feels like I've got to be missing something simple here -- any suggestions as to why the single row repeats in the display?



And has anyone had any experience with using custom properties as sources for the grid columns? (Not sure why this doesn't work ....)
By Trent L. Taylor - 6/23/2008

(The grid doesn't appear to like the custom properties, so I've just loaded a couple of varchar fields as columns and under those conditions it appears to work ok for setting up the columns and displaying them).

You need to override the GetCustomBindablePropertyDescriptors method and provide a ReflectionPropertyDescriptor for each custom property so that it can be bound.

but the grid displays just the first row and then repeats the first row for all the remaining rows that it displays.

It sounds like something is repositioning the BO for each exposed row in the IBindingList implementation.  This can happen for a number of reasons: filters, sorts, other navigation code within an event of the BO, etc.

And has anyone had any experience with using custom properties as sources for the grid columns? (Not sure why this doesn't work ....)

There are a LOT of posts out here on the forum in this regard.  Here are just a few:

http://forum.strataframe.net/FindPost15985.aspx (This sample shows how to create a custom property and add a broken rule to that custom property)

http://forum.strataframe.net/FindPost17063.aspx

By Mark Dowlearn - 6/23/2008

Hello, Trent -

>>>You need to override the GetCustomBindablePropertyDescriptors method and provide a ReflectionPropertyDescriptor for each custom property so that it can be bound.

I've already overridden the GetCustomBindablePropertyDescriptors method and have been using custom properties successfully with other controls.  It appears to me to be something specific to the interaction with SF and the DevExpress control. 

>>>It sounds like something is repositioning the BO for each exposed row in the IBindingList implementation.  This can happen for a number of reasons: filters, sorts, other navigation code within an event of the BO, etc.

Hmmm....There are no filters or sorts on the BO, just a plain vanilla "FillAll()" and hook it up to the grid using a WebBusinessBindingSource.  No navigation code either.  I'll look at debugging through the source code unless there's something specific you would suggest.

>>>There are a LOT of posts out here on the forum in this regard.  Here are just a few:
>>>http://forum.strataframe.net/FindPost15985.aspx (This sample shows how to create a custom property and add a broken rule to that custom property)
>>>http://forum.strataframe.net/FindPost17063.aspx

Yes, these have been very helpful.  Still don't know why custom properties work with other controls but not the DevExpress control using the WebBusinessBindingSource, however.

 

By Trent L. Taylor - 6/23/2008

I've already overridden the GetCustomBindablePropertyDescriptors method and have been using custom properties successfully with other controls.  It appears to me to be something specific to the interaction with SF and the DevExpress control.

The DevExpress control should be totally irrelevant as the IBindingList implementation doesn't care about the control but rather speaking straight to the interface properties and methods.

The first thing I would do is take the BO in question and bind it to a WinForms grid through a standard BBS, then if that worked, take the WBBS and binding to a control other than the DevExpress grid (I have never attempted to use the web DevExpress grid, so I am afraid I cannot be of much help there without having to setup and get my head into this control itself, though I do not beleive that this is the problem anyway).

By Mark Dowlearn - 6/23/2008

Thans -- I'll contintue to work on figuring it out.

m

By Trent L. Taylor - 6/23/2008

Let me know if you don't make any progress and I will see if I can reproduce.
By Chan - 6/25/2008

Hi,

I also faced the same problem. I tried to bind the same WebBBS to AspxCombobox and it is working fine.



Any ideas?



Thank you
By Chan - 6/30/2008

Hi,

Any update on this? I need it very urgently.

Thank you
By Trent L. Taylor - 6/30/2008

We have it on a list to look at but as of yet we have not reproduced.  You are welcome to post a sample that reproduces the problem so that we can more quickly reproduce the issue.
By Chan - 7/1/2008

Hi,

Please find the attached sample project.



Thank you
By Chan - 7/15/2008

Hi,

Any updates?



Thank you
By Trent L. Taylor - 7/17/2008

Chan,

This is actually something that we are looking at but we are in the middle of SF class this week and next.  So we will try and get you some answers as soon as we can.  Thanks.

By Chan - 7/23/2008

Hi,

Shall I have this fix ASAP? I need it urgently. I am "stuck" here cannot deliver.



Sorry for any inconvenience.



Thank you
By StrataFrame Team - 7/24/2008

I finally discovered that the Telerik and DevExpress grids do not use the enumerator of the DataSourceView in a predictable fashion.  They create their own list of items to store in the list because they provide paging.  This allows them to use a for loop, not a foreach loop to build the grid from only the items they want to display.  We had to change the WBBS enumerator to return a new BO reference like the winforms BBS does.  It's fixed, and we'll try to get a build together so we can post it as the new 1.6.6 Beta. 
By Trent L. Taylor - 7/24/2008

Chan,

You can get the most recent version here that has that fix: http://forum.strataframe.net/FindPost18055.aspx .

By Chan - 7/24/2008

Thank you very very much


By StrataFrame Team - 7/25/2008

Have you tried it to see if it works properly?  Let me know if it's still acting weird.