Article View: borland.public.csharpbuilder.winforms.controls.using
Article #39Binding DataGrid to an hierarchy of objects - problem with Styles at the bottom of the hierarchy
From: Terentius Neo
Date: Wed, 31 Aug 2005 16:27
Date: Wed, 31 Aug 2005 16:27
22 lines
1978 bytes
1978 bytes
I have a DataGrid binded to a custom hierarchy. It is an ArrayList of
objects. Each object has a public property returning a new ArrayList of
sublevel objects (which may again have sublevels of their own). All the
objects are of the same base type.
Everything works fine until there are no objects at the lower level.
Despite this the link to the sublevel is still shown in the DataGrid.
Clicking it gives the following error message ("Caption" is a public
property of linked to a DataGridColumStyle):
"The project encountered unhandled exception class
System.InvalidOperationException with message
'The 'Caption' DataGridColumnStyle cannot be used because it is not
associated with a Property or Column in the Datasource"
If I remove the DataGridColumnStyles this does not happen. Also the link
to the lower level is not shown in the DataGrid unless there really are
objects at that level.
Could somebody give a hint how to fix this?
Terentius
Technical Details
Message-ID:
<4315da5f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newspeer.tds.net!38.119.100.82.MISMATCH!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1eff3c,c99d2f5256249f4a,start X-Google-Attributes: gid1eff3c,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 31 Aug 2005 19:27:56 +0300 From: Terentius Neo <unknown@user.domain> User-Agent: Mozilla Thunderbird 1.0.5 (Windows/20050711) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.csharpbuilder.winforms.controls.using Subject: Binding DataGrid to an hierarchy of objects - problem with Styles at the bottom of the hierarchy Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 80.221.176.228 Message-ID: <4315da5f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1125505631 80.221.176.228 (31 Aug 2005 09:27:11 -0700) Lines: 22 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newspeer.tds.net!38.119.100.82.MISMATCH!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail