Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2006

Tip: Looking for answers? Try searching our database.

binding to an empty IBindingListView instance fails

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dirk.bonne@gmail.com - 07 Feb 2006 10:40 GMT
Hi,

I have created my own CustomBindingListView by deriving from
IBindingListView.

Binding a DataGridView to this CustomBindingListView works fine, and
when updates arrive on the underlying data, the DataGridView gets
updated correctly (both changes and additions/removals to the
underlying records set can be seen in the grid).

Except in one case: When I bind to this CustomBindingListView when
there are no items yet in the view.

Then when at a later stage the view gets populated, the grid shows only
empty cells. It seems to recognize that the records are there, and it
shows the rows, except the cells themselves are empty.

When debugging I can see that the rows are requested from the
CustomBindingListView, but that the properties of the items themselves
are never accessed in this case.

I now use a rather painful workaround, that I defer binding until the
binding source get populated, but this is rather a painful business
(register the ListChanged event, watching the CustomBindingListView
instance and check in the handler if the list is non empty. If so, bind
and and unregister the event).

Help! ;-)
Dirk
Bart Mermuys - 07 Feb 2006 13:06 GMT
Hi,

> Hi,
>
[quoted text clipped - 22 lines]
> instance and check in the handler if the list is non empty. If so, bind
> and and unregister the event).

A DataView also implements IBindingListView and it doesn't exhibit such
behaviour.

Did you also implement ITypedList *or* did you put a BindingSource between
your custom list and the DataGridView ?

If you did neither, then this might cause the problem because when the list
is empty "DataBinding" can't determine the properties and it thinks there
are no properties.

HTH,
Greetings

> Help! ;-)
> Dirk
dirk.bonne@gmail.com - 07 Feb 2006 14:40 GMT
Hi Bart,

thanks a lot!!!! Thats exactly what I needed to do: implement
ITypedList. I am only a two month old .net baby ;-), so there is a lot
of "know how" I don't know yet about.

saved,
Dirk

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.