Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Why does setting ComboBox's Datasource fire BeginEdit?

Posted on 2010-09-10
1
Medium Priority
?
677 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…

610 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