I have an UltraGrid located on the first tab of an UltraTabControl. When I add a UserControl to the RowEditTemplate, design mode breaks. Whats the deal? If you stick with built in controls either infragistics or MS, all is fine.
Here is a pic of the error message:
http://twitpic.com/3rjdbl
When I remove the UserControls from the RowEditTemplate, design mode works again. Is there some kind of bug here?
-Ken
I will try to come up with a sample the first break I get.
Hm, that's odd. Except for the accessing of the grid's BindingContext, there's nothing in the call stack that even references the Infragistics assemblies. Looks like this might be a bug in Visual Studio. If you can post a small sample project demonstrating the error, I'd be happy to take a look at it. But I can't get the problem to occur on my machine with the information you have here.
So here is the fix. I removed the databinding generated code from the designer file and into the forms constructor....like so.
public AnalysisProfileForm(){ InitializeComponent(); this.eligibleDaysFilters1.DataBindings.Add(new System.Windows.Forms.Binding("Days", this.ultraGridRowEditTemplate, "Days", true)); this.timeFormatter.DataBindings.Add(new System.Windows.Forms.Binding("TimeRange", this.ultraGridRowEditTemplate, "TimeRange", true)); this.DoubleBuffered = true; this.UpdateStyles();}
Here is the call stack and this only happens in design mode. When I have a custom User Control and I bind the control to the RowEditTemplate property....If I comment out the following line of code the error stops happening and design mode will render out.
this.timeFormatter.DataBindings.Add(new System.Windows.Forms.Binding( "TimeRange", this.ultraGridRowEditTemplate, "TimeRange", true));
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)at System.Collections.Hashtable.Add(Object key, Object value)at System.Windows.Forms.BindingContext.EnsureListManager(Object dataSource, String dataMember)at System.Windows.Forms.BindingContext.get_Item(Object dataSource)at Infragistics.Win.UltraWinGrid.UltraGridRowEditTemplate.get_BindingContext()at System.Windows.Forms.Control.get_BindingContextInternal()at System.Windows.Forms.ContainerControl.get_BindingContext()at System.Windows.Forms.Control.UpdateBindings()at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)at System.Windows.Forms.ContainerControl.OnCreateControl()at System.Windows.Forms.UserControl.OnCreateControl()at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)at System.Windows.Forms.Control.CreateControl()at System.Windows.Forms.Control.ControlCollection.Add(Control value)at System.Windows.Forms.Form.ControlCollection.Add(Control value)at System.Windows.Forms.Design.ControlDesigner.DesignerControlCollection.Add(Control c)
Hi Ken,
This error message doesn't say much, and you didn't post the call stack, so it's hard to guess what's happening here.
Can you post a small sample project demonstrating the error so we can check this out? You can attach files to your posts on the Options tab.