Infragistics grid in win desk top application, design view is not available for viewing - visual-studio-2010

I have a weird situation with Infragistics grid in desktop windows application. It is Visual Studio 2010.
I have several grids placed in one form control. It worked fine and I was able to see both Code Behind view and Designer view to make modifications. Then several other developers worked with the same control. It still runs fine, no problem. I still can see and modify code behind. But I can not access and view design view for some reason. It just gives me the error message :
Key already exists Parameter name: Key
Here is call stack:
at Infragistics.Shared.KeyedSubObjectsCollectionBase.ValidateKeyDoesNotExist(String key, IKeyedSubObject ignoreObject)
at Infragistics.Shared.KeyedSubObjectsCollectionBase.ValidateKey(String key, IKeyedSubObject ignoreObject)
at Infragistics.Shared.KeyedSubObjectsCollectionBase.InternalAdd(IKeyedSubObject obj)
at Infragistics.Win.UltraWinGrid.ColumnsCollection.InternalAdd(UltraGridColumn column)
at Infragistics.Win.UltraWinGrid.UltraGridBand.InitColumns(UltraGridBand[] oldBands)
at Infragistics.Win.UltraWinGrid.UltraGridBand.InitListManager(BindingManagerBase bindingManager, String dataMember, UltraGridBand[] oldBands)
at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated(BindingManagerBase bindingManager)
at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated()
at Infragistics.Win.UltraWinGrid.UltraGridBase.Set_ListManager(Object newDataSource, String newDataMember)
at Infragistics.Win.UltraWinGrid.UltraGridBase.VerifyDataSourceAttached()
at Infragistics.Win.UltraWinGrid.UltraGridBase.DesignTimeDataSourceInitialization()
at Infragistics.Win.UltraWinGrid.UltraGridBase.OnDesignerHostLoadComplete(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.ComponentModel.Design.DesignerHost.OnLoadComplete(EventArgs e)
at System.ComponentModel.Design.DesignerHost.System.ComponentModel.Design.Serialization.IDesignerLoaderHost.EndLoad(String rootClassName, Boolean successful, ICollection errorCollection)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.OnEndLoad(Boolean successful, ICollection errors)
at System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.OnEndLoad(Boolean successful, ICollection errors)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.System.ComponentModel.Design.Serialization.IDesignerLoaderService.DependentLoadComplete(Boolean successful, ICollection errorCollection)
at System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost host)
at System.ComponentModel.Design.DesignerHost.BeginLoad(DesignerLoader loader)
I really need to see and modify design view of the control.
I would highly appreciate if anybody can advise how to solve this.
Thanks!

Seems like I was able to pinpoint the issue. It was one of the data source objects that was added drag and drop way. I opened the file ..Designer.cs and manually commented all lines with it. The design view started working again.
Thanks to everyone who was considering to assist.

Related

How to make a button on a application open a register page in Visual Studio

I'm making an application group chat in Visual Studio learn a bit more, all is good so far, so I've made my design and coded most of what I need, I have added a Button and called it Register now what I want is when people click it it will open another page or some type of menu where people can type there information in to register, I thought somthing like this or is this so wrong.
private void RegisterButton_Click(object sender, RoutedEventArgs e)
{
//what gose here
}
You can use Response.Redirect inside the button click to do this.
Refer to these articles:-
https://msdn.microsoft.com/en-us/library/a8wa7sdt(v=vs.110).aspx
https://support.microsoft.com/en-sg/kb/307903

How to use an IEnumerable<T> business object as RDLC datasource, the way it REALLY works?

I have the hardest time creating an WebForms RDLC report with my business objects, in Visual Studio 2010. I am using the designer to build my report.
In the Report Data View of VS2010 I select New/Dataset... Strange enough, the Data Source Configuration Wizard immediately pops up, covering the Dataset Properties dialog.
When I cancel the Wizard, I am able to manipulate the Dataset Properties dialog somewhat, but none of my business objects does show up. Actually, nothing selectable shows up at all.
What do I need to have my business object selectable?
Note: Earlier in the project, this once worked. I must have changed something, but what?
I have read this question, but my Dataset is in the same project, on the ASPX-Page's code behind file. I have set it up like so:
public IEnumerable<MyDto> Getxy() {
return new List<MyDto>(); //TODO later use real data.
}
I have also read this one but my object already matches what's suggested there. It is a really simple POCO DTO's with no constructor (which makes it automatically have a public parameterless constructor)

Windows Form -- behavior of buttons?

First time I've used the windows form so I'm not very familiar with the interface. But how do I set behaviors when I add buttons? For example, if I want to click "Button 1" and have it open up a new window to enter information in different fields, how is this done?
Thank you.
edit: Sorry, I forgot to include the language. It's in C#, and I'm using MS Visual Studios. I've never really programed in C#.
Another question that just popped up: could I do this Windows Form in other languages such as C++?
Yes the comment above is key but, if your are using the UI designer on a windows form then under the properties tab on the side of visueal studios, you can view 'events'. from here double click the event you want, probably 'onclick'. This will create a method stub with the event handler automatically set up.
Look something like:
public void Button1_OnClick(Object sender, EventArgs e){
// open the other window for input
Form whateverForm = new Form();
whateverForm.show();
}
Hope this helps. Sorry im not sure about any c++
[Edit]
tutorial not great but take a look:
http://www.ehow.com/how_7241167_tutorial-microsoft-visual-studio.html

Can't Find Specific Listbox for Windows Phone

I am right now looking for a way for a user to open a listbox, choose an option, and the program continues to run, considering the desired option. My best option was to use a listbox I found in the Settings section of the phone.
I don't have a way of explaining this control completely, so I'll use an example. If you go into the Regions & Language section of the phone and then hit Region, you will notice a list pops open. The same listbox is opened when choosing a ringtone. This is exactly what I need for my application. The only problem is, I don't know what it is called. Help!
I included two images
That control is not called a ListBox, Windows Phone calls it the ListPicker. Here's an article explaining how to use it.
The control is included in the Silverlight Toolkit for Windows Phone.
Note that the article is old and a few of the properties for the control have been renamed / made read-only in the latest release of the toolkit.
What you need is the ListPicker from the Windows Phone Toolkit. You'll need to handle changing any settings yourself. This can be done through binding to a property that gets changed or via code that you write.
<toolkit:ListPicker Header="Language" SelectedItem="{Binding SelectedLanguage, Mode=TwoWay}"
FullModeHeader="LANGUAGES" ExpansionMode="FullScreenOnly"
SelectionChanged="ListPicker_SelectionChanged">
<sys:String>English</sys:String>
<sys:String>Spanish</sys:String>
<sys:String>French</sys:String>
</toolkit:ListPicker>
If you need to handle changes:
private void ListPicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
// handle any changes that are needed
}

Where should I attach solution or project events in my Visual Studio add-in?

Can anyone suggest the best place to add solution or project events, such as ProjectAdded, to a Visual Studio add-in?
If I do this when the add-in connects then there's no solution loaded, so how can I tell when a solution has been loaded?
For example, if I write an event to handle project items being added, where should I attach this? The event would be fired by the project, and that in turn by the solution, so I can't attach the events when the add-in connects because there is no solution when the add-in connects.
On the other hand, if I add them in the Exec() event then I need to do checks such as whether the event has been attached already, and I'm sure there must be a neater way sometime between the connection events and the Exec() event.
You probably figured this out long ago, but anyway: You can setup your events from within OnConnection like shown below, this is a snippet of an Addin's Connect class (assuming you're using c#):
using System;
using System.Globalization;
using System.Reflection;
using System.Resources;
using EnvDTE;
using EnvDTE80;
using Extensibility;
using Microsoft.VisualStudio.CommandBars;
namespace MyAddin1
{
/// <summary>The object for implementing an Add-in.</summary>
/// <seealso class='IDTExtensibility2' />
public class Connect : IDTExtensibility2, IDTCommandTarget
{
private DTE2 _applicationObject;
private AddIn _addInInstance;
private SolutionEvents _solutionEvents;
public void OnConnection(object application, ext_ConnectMode connectMode,
object addInInst, ref Array custom)
{
_applicationObject = (DTE2)application;
_addInInstance = (AddIn)addInInst;
// check the value of connectMode here, depending on your scenario
if(connectMode == ...)
SetupEvents();
}
private void SetupEvents()
{
// this is important ...
_solutionEvents = _applicationObject.Events.SolutionEvents;
// wire up the events you need
_solutionEvents.Opened += new _dispSolutionEvents_OpenedEventHandler(_solutionEvents_Opened);
_solutionEvents.AfterClosing += new _dispSolutionEvents_AfterClosingEventHandler(_solutionEvents_AfterClosing);
_solutionEvents.ProjectAdded += new _dispSolutionEvents_ProjectAddedEventHandler(_solutionEvents_ProjectAdded);
}
// add procedures to handle the events here, plus any other
// handling you need, ie. OnDisconnection and friends
}
The main point is, to wire up the solution and project events you need, it's not important if a solution or project is already loaded. They're not attached to any particular solution or project, they're provided by the Visual Studio object model and are embedded within the EnvDTE namespace.
It wouldn't make much sense to do anything else anyway, since you can configure an addin to load when VS starts, and in this case there will never ever be any solutions/projects loaded.
There's a few catches though:
It's important that you keep a reference to the SolutionEvents class as a member variable within your connect class, otherwise the events will never fire, (see also here).
You need to make sure you check the connectMode parameter passed into OnConnection. This gets called multiple times with different parameters, and if you do it the wrong way you may get the event wired up multiple times, which definetly will be a problem. Also, usually any Addin IDE, like Menus and stuff, is set up from within OnConnection, so you may end up with duplicate menu items if you don't do it right.
Here's a few pointers, some of the code provided is VB code, in case you're looking for that:
HOWTO: Adding buttons, commandbars and toolbars to Visual Studio .NET from an add-in
HOWTO: Getting Project and ProjectItem events from a Visual Studio .NET add-in.
HOWTO: Add an event handler from a Visual Studio add-in
Finally, here's a list of articles, about 70% of them cover basic and advanced topics regarding addins:
Resources about Visual Studio .NET extensibility
Find the section entitled MZ-Tools Articles Series (about add-ins) and have a look at what's covered there.

Resources