How do I bind a DevEx grid to a BO?


Author
Message
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi,

I've created a BO and want to bind it to a Dev Express Grid but I just can't work out how to.

I see that if I drop a SF control onto a form the control has a Business Object property that I can use but that property isn't available for a Dev Express Grid control. I've had a look at the Dev Express Wrapper sample (under ..\VB.Net Samples\EnhancedList) and see that Dev Express Grid doesn't have a Business Object property but the Grid's "Run Designer" button is greyed out so I can't see what is going on within the grid itself to see how the data binding is achieved.

Can you please point me in the right direction.

BTW I think your help file is pretty good but it would sure be a lot better if the search facility worked - no matter what search value I use it always returns "no topics found".

TIA - Peter

Replies
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Peter.

I'm not sure I can help you here, but don't worry, if I get it wrong they will.

Does it work if you change your code so it looks like:

Private Sub boHID_ParentFormLoading() Handles boHID.ParentFormLoading

    Me.boHID.FillDataTable("SELECT * FROM tblHIDHides")

End Sub

 

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
The problem is that your business object is expecting to find a DataSource with the DataSourceKey of "" within the DataSources collection, but it doesn't exist.  You need to check your AppMain.vb code file and look at the SetDataSources() method.  If you're using the ConnectionManager, then you need to check the first parameter in your AddRequiredDataSourceItem() call and make sure it's an empty string.  If you're adding the data source manually, you need to make sure the first parameter to the New SqlDataSourceItem() constructor call is an empty string.  These parameters define the DataSourceKey for the data source within the collection.  So, that value has to match the value on your business objects, which is why the template has an empty string for both of those values.
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