.NET C # ComboBox the default text

I have a combobox populated via Datasource and when the application runs it shows the first item instead of the default text setup in the properties. How can I accomplish this? EDIT: The data comes from an API: loteamentos = JsonConvert.DeserializeOb

How to configure debugging for the system tested in unit tests?

How do you set up debugging so that you can step through your system under test code? I've got this test: [Test] public void GetDeviceSettings_is_called() { //Arrange var mockDeviceInteractions = new Mock<IDeviceInteractions>(); mockDeviceInteractio

How to navigate with webbrowser every time on an html page?

I have 44 html addresses and i want each time to navigate to one html address. for (int i = 1; i < 45; i++) { adrBarTextBox.Text = sourceUrl + i; getCurrentBrowser().Navigate(adrBarTextBox.Text); } In the webbrowser document completed event i need th

Windows API code pack: Where is it?

Why has itself and the evidence it ever existed been removed? Only a half year ago it was promoted on channel9 as Something that should be in everyones pack -- today the Microsoft Archive is "retired" and totally keeps quiet that the API code pa

How can I get assigned values ​​for enum members?

The following code returns One, Two, Three, where I expect GetNames to do that and GetValues to return 2, 5, 10: enum Nums { One = 2, Two = 5, Three = 10 } class Program { static void Main() { var vals = Enum.GetValues(typeof(Nums)); } } What is up h

Visual Studio - IntelliSense for a javascript custom object

I created the following javascript object: var Content = Content || {}; // Constructor defines properties and inits object Content.ProductManager = function () { // ... }; Content.ProductManager.prototype = function () { // // private members // var

Combined value dropdownlist

Is it possible to combine dropdownlist values from an entity. Say I have a person class with Last Name and First Name I have tried doing this: ViewBag.uservalues = new SelectList(db.Persons, "ID", "FirstName" + " " + "La

Save the list to a file on disk

I build WPF program , And i use this code to save a List of objects to a File: var list = new ArrayList(); list.Add("item1"); list.Add("item2"); // Serialize the list to a file var serializer = new BinaryFormatter(); using (var stream

Skip the methods in the interface

I have the following interface: public interface IModuleTile { void AddEvent(/*Type here*/ methodToAdd); void RemoveEvent(/*Type here*/ methodToRemove); } And I want to do this: public partial class TestControl : UserControl, IModuleTile { public Tes

How to edit multiple models in a single razor view

I am new to MVC3, I have an multiple models like BussinessDetails,ContactPerson,ServiceArea,Address and many more models. I have a single view page where shared view pages like Contacts,BusinessDetails,Address,ServiceArea etc.these are all in tabs. T

Accepted collection to work with Excel data

I have a bunch of data that I'm pulling into my application which frankly is best represented as an Excel spreadsheet. By this I mean: There are a lot of columns which need 'summing up' There is a reasonable amount of data (basically a sheet of numbe

JavaScript code to refresh the page and / or the telerik grid

I need some kind of code which will refresh the page every 5min and if not the page then just the Telerik grid displayed on it since that's all that's rly needed. Only other thing would be if it was after 5min of no activity on the page if possible b

What does runtime mean in the context of .NET CLR?

What does "Runtime" mean in the context of the .NET Common Language Runtime?The runtime in that context is an execution platform. I.e. it defines how applications are loaded and executed. It provides a set of services common to all applications

MathML equation editor widget for the ASP.NET site

I am looking for a widget that I can plug in to my ASP.NET site that will allow users to create math formulas with their associated MathML. Ideally this would be similar to an HTML editor like TinyMCE. There have been solutions in the past (see MathM

ASP.NET MVC Responsive Framework

Is it possible to apply reactive framework (Rx) in MVC application? or is it applicable for WPF?While it's possible to use it in any part of .NET it is especially useful when there is some user interaction. With MVC or any server side technology, the

ASP.Net Persistent Objects

I'm building an ASP.Net website. I have a "cart" class which stores the items in the users cart. I don't want to re query the database every time the page reloads to populate the cart items stored in this object. Is the best way to store/persist

Is it a bad idea to add a period to a .Net solution file?

If I was using a "Partitioned Single Solution" strategy to build my .Net projects and solutions, could anyone comment on, or share any experiences about why it would be a bad idea to include dot notation in my solution names as such... master.sl

Delete all directory permissions

In C# (2.0) How do I remove all permissions to a directory, so I can limit the access. I will be adding access back to a limited set of users.Look at the classes in the System.Security.AccessControl namespace, and especially the DirectorySecurity.Rem

How do you sell the idea of ​​ASP.net versus OSS?

How many of you tried to sell ASP.net to client or boss but go up against the wall of free OSS stacks(PHP, RoR...etc.)? Nothing wrong with OSS or ASP.net. I'm interesting in how to overcome selling ASP.net solution against OSS.ASP.NET can be free/OSS