[Mono-dev] [PATCH] fix for functional incompatibility in HierarchicalDataBoundControl

James Fitzsimons james.fitzsimons at gmail.com
Thu May 22 02:29:47 EDT 2008

Hi all,

Could someone review this patch please?

James Fitzsimons

2008/5/18 James Fitzsimons <james.fitzsimons at gmail.com>:

> Hi all,
> The attached patch fixes an in incompatibility between mono and the
> Microsoft framework with respect to the HierarchicaDataBoundControl. In my
> project I have a class (CategoryHierarchy) that implements
> IHierarchicalEnumerable and also have a custom control (CategoryControl)
> that extends HierarchicaDataBoundControl. In the Microsoft.Net framework I
> can set the datasource of my CategoryControl to be an instance of
> CategoryHierarchy and everything works as expected. This throws a null
> reference exception in Mono because in the GetData method calls the
> GetDataSource method which returns the datasource as a
> IHierarchicalDataSource. My CategoryHierarchy doesn't implement
> IHierarchicalDataSource hence the null reference exception.
> I noticed when inspecting the type of the returned
> HierarchicalDataSourceView in visual studio that it was a
> ReadOnlyDataSourceView. There is no documentation on this class and no
> implementation in Mono so I inferred that it must be a basic default
> implementation of HierarchicalDataSourceView that is used in the case where
> the datasource implements IHierarchicalEnumerable. I have added a default
> implementation of  HierarchicalDataSourceView  (also called
> ReadOnlyDataSourceView for conformity) and modified the GetData method of
> the HierarchicalDataBoundControl such that if the datasource implements
> IHierarchicalEnumerable it returns a new instance of ReadOnlyDataSourceView
> instead of null.
> I've also added a unit test for this.
> Hopefully I've explained that clearly?
> Cheers,
> James Fitzsimons
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080522/1848a603/attachment.html 

More information about the Mono-devel-list mailing list