CslaDataSource & Infragistics Web Grid

CslaDataSource & Infragistics Web Grid

Old forum URL: forums.lhotka.net/forums/t/5291.aspx


ajj3085 posted on Friday, August 22, 2008

Hi,

I'm trying to figure out why Infragistics Web Grid isn't playing nice when I use a CslaDataSource.  One of the issues is that the grid doesn't detect the child hierarchy.

I have a collection of Items, and each Item has a SubItems property, which is a collection of SubItem instances.  Looking at the code, I'm wondering if ObjectViewSchema class returning null for GetChildren is the reason.  Also, the property sample value is set to null in CslaDesignerDataSourceView.  I doubt that'd have any impact though.

The main issue though is that the grid doesn't update the html... so basically it's broken.

Unfortunately Infragistics is unwilling to do anything but try with their controls DataSourceId not set, so I'm having a tough time figuring out what is causing their control grief.

Anyone been down this path lately?

ajj3085 replied on Friday, August 22, 2008

Well, even if you implement GetChildren, it doesn't get called.  Not sure why..

Fintanv replied on Monday, August 25, 2008

I do not have a solution but I have dealt with Infragistics 'support' on more than one occassion.  Getting through their first line of support (defence) can be a challange, you really have to hand hold them through the process and spoon feed them the issue.  Having a project that you write that shows the issue is almost a hard requirement.  Once they agree to log the issue into their system it appears to go to the real developers of the components, so your chances of getting a resolution go up at this point.

Best of luck.  I sympathize.

ajj3085 replied on Monday, August 25, 2008

Well, I did give them a solution, and the support tech. balked at teh CslaDataSource.. saying "it works if you don't have a DataSourceId." 

I am leaning more toward something with the CslaDataSource though, as the Janus control throws an exception when bound to a CslaDataSource.... and the same exception I see when I first open the designer with the Infragistics grid.  It's a TargetInvokationException.  So I'm going to try and dig more into the CslaDataSource.   I was hoping to say "well, Janus your competitor has a grid that works.."  Ah well.

igtonyl replied on Wednesday, September 03, 2008

The WebGrid relies on the datasource interface implementation to provide functionality. In a scenario like this where binding to a particular datasource throws an exception, I would tend to focus more on the datasource implementation itself rather than the webgrid.

The fact that your ObjectViewSchema class is returning null for GetChildren may indeed be the cause of the problem. The Schema is used by the grid to determine the "Band" structure which defines the columns for each level of hierarchy. If it can't get a subobject, it has no way to identify what the child hierarchy is supposed to look like.

You can manually create bands through the ASPX, by following the structure present for the parent band. Under the Bands tag in your markup, simply add another Band tag, and then add the appropriate columns. This can also be done at runtime by modifying the bands collection.

Hope this helps,
-Tony

Anthony Lombardo
Developer Evangelist
Infragistics, Inc.
www.infragistics.com

ajj3085 replied on Thursday, September 04, 2008

igtonyl:
The WebGrid relies on the datasource interface implementation to provide functionality. In a scenario like this where binding to a particular datasource throws an exception, I would tend to focus more on the datasource implementation itself rather than the webgrid.


But it doesn't when used with MS controls, and I've not found specifically that it was the DataSource that was throwing the exception.  For all I know the WebGrid designer was throwing the exception.  I really don't know.

igtonyl:
The fact that your ObjectViewSchema class is returning null for GetChildren may indeed be the cause of the problem. The Schema is used by the grid to determine the "Band" structure which defines the columns for each level of hierarchy.


Except that I found that even if I implemented the GetChildren method, it is NEVER called by the WebGrid's designer.  That was the first thing I did to try and get the hierarchy to display.

igtonyl:
If it can't get a subobject, it has no way to identify what the child hierarchy is supposed to look like. You can manually create bands through the ASPX, by following the structure present for the parent band. Under the Bands tag in your markup, simply add another Band tag, and then add the appropriate columns. This can also be done at runtime by modifying the bands collection.


Unfortunately it doesn't help, since the designer doesn't modify the html, and so any changes I make are lost.  Of course the whole point of the designer is to NOT have to setup the control via code manually.  I've found though that the webgrid designer failing to modify the aspx page isn't the only problem; for example, I can't always add a control from the toolbox.  Double clicking simply does nothing.  It seems to work if I create a new solution.. but that doesn't help me with the solution I already have.

At any rate I finished what I needed to finish and have moved on.  Hopefully at some point I'll be able to revisit this issue, but for now I'm pretty dumbfounded, because the WinForms controls  have been working extremely well for me, but the web controls have been a big letdown so far.

Copyright (c) Marimer LLC