?
Solved

Why does setting ComboBox's Datasource fire BeginEdit?

Posted on 2010-09-10
1
Medium Priority
?
669 Views
Last Modified: 2012-08-14
I have a combobox whose DataSource is set to
a List of IEditableObjects.  The idea is the user will select an item from the list to create a parent-child link.

What's happening is upon setting the DataSource, BeginEdit is called for each object in the list.  I assume this is done during creation of the BindingContext however the objects are not editable at this stage.

Not only does this unneccessarily add overhead the objects in the list remain in a permanent state of in edit mode.  I know I can manually call CancelEdit for each item in the list but shouldn't there be a simpler solution.
0
Comment
Question by:KurgerBurger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 31

Accepted Solution

by:
MlandaT earned 500 total points
ID: 33652523
The IEditableObjects interface provides functionality to commit or rollback changes to an object that is used as a data source. Once you use the list of IEditableObjects as a datasource, the objects are readied for manipulation... NOTE: The object itself has no way of telling whether it is being bound to an object that supports editing or not. Once used as a DataSource, there is a possibility that the UI element being bound to allows editing. This is unfortunately standard behaviour and well... maybe just a fact of life... It does sound wasteful. The alternative is not to use the interface?
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question