Click here to Skip to main content
15,917,795 members
Home / Discussions / C#
   

C#

 
GeneralRe: Event marshalling across thread boundaries? Pin
Nick Parker2-Nov-03 10:55
protectorNick Parker2-Nov-03 10:55 
GeneralRe: Event marshalling across thread boundaries? Pin
Heath Stewart2-Nov-03 10:58
protectorHeath Stewart2-Nov-03 10:58 
GeneralHtml Control Development in C# Pin
Inam2-Nov-03 7:55
Inam2-Nov-03 7:55 
GeneralRe: Html Control Development in C# Pin
Nick Parker2-Nov-03 8:14
protectorNick Parker2-Nov-03 8:14 
GeneralRe: Html Control Development in C# Pin
Inam2-Nov-03 8:27
Inam2-Nov-03 8:27 
GeneralRe: Html Control Development in C# Pin
J. Dunlap2-Nov-03 8:34
J. Dunlap2-Nov-03 8:34 
GeneralRe: Html Control Development in C# Pin
J. Dunlap2-Nov-03 8:17
J. Dunlap2-Nov-03 8:17 
GeneralCombo box binding bugs Pin
Wjousts2-Nov-03 6:07
Wjousts2-Nov-03 6:07 
I have a form which is supposed to display data from a database. The form has many controls which are bound to various fields in the database. Now among the controls I have some comboboxes. The role of these comboboxes is supposed to be to limit the entries the user can make to a small set of values. Now, I want to be clear here, I am NOT using the database to populate a combobox as in about 95% of all examples I've found do. Okay, so I tried this:

MyComboBox.DataBindings.Add(new Binding("Text",MyDataView,"MyField");<br />


This will display the correct string from the database in the combobox, but any changes don't get passed back to the datasource.
So, I tried this:

MyComboBox.DataBindings.Add(new Binding("SelectedItem",MyDataView,"MyField");<br />


The problem here is that the very act of binding the data seems to trick the dataset into thinking that that row has been changed - It's RowState gets changed to modified whether anything has been done to or not.

So, at this point I was getting frustrated and desperate. I decided that what I should do is create a new ComboBox class that inherits from the original class and add an extra property that I could bind to. That way I could keep control of it, right? Wrong! Doesn't work. I even tried this:

public class DataComboBox : ComboBox
{
	private string bound;
	public string Bound
	{
		get { return bound; }
		set 
		{
			if (value != bound)
			{
				bound = value;
			}
		}
	}
}


And this:

MyComboBox.DataBindings.Add(new Binding("Bound",MyDataView,"MyField");<br />


Note that this doesn't even change the combobox at all at this point, and even this causes the dataset to think that the row has been changed! How can this be??? I'm totally stumped.

Anybody got any ideas?

Cheers
GeneralRe: Combo box binding bugs Pin
leppie2-Nov-03 6:39
leppie2-Nov-03 6:39 
GeneralRe: Combo box binding bugs Pin
Wjousts2-Nov-03 11:32
Wjousts2-Nov-03 11:32 
GeneralDataGrid, binding to Collection Pin
partyganger2-Nov-03 5:11
partyganger2-Nov-03 5:11 
GeneralRe: DataGrid, binding to Collection Pin
Wjousts2-Nov-03 6:12
Wjousts2-Nov-03 6:12 
GeneralRe: DataGrid, binding to Collection Pin
partyganger2-Nov-03 6:25
partyganger2-Nov-03 6:25 
GeneralRe: DataGrid, binding to Collection Pin
Wjousts3-Nov-03 3:58
Wjousts3-Nov-03 3:58 
Generalweird break point Pin
novachen2-Nov-03 2:57
novachen2-Nov-03 2:57 
GeneralRe: weird break point Pin
leppie2-Nov-03 4:43
leppie2-Nov-03 4:43 
GeneralRe: weird break point Pin
novachen2-Nov-03 13:49
novachen2-Nov-03 13:49 
GeneralRe: weird break point Pin
Rahul Walavalkar3-Nov-03 2:29
Rahul Walavalkar3-Nov-03 2:29 
Generalpanel round corners... Pin
FreJa2-Nov-03 0:28
FreJa2-Nov-03 0:28 
GeneralRe: panel round corners... Pin
Heath Stewart2-Nov-03 11:01
protectorHeath Stewart2-Nov-03 11:01 
GeneralRe: panel round corners... Pin
Douglas Troy4-Nov-03 6:40
Douglas Troy4-Nov-03 6:40 
GeneralFor a inherent class, why its events can not be inherented Pin
chq121-Nov-03 13:42
chq121-Nov-03 13:42 
GeneralRe: For a inherent class, why its events can not be inherented Pin
leppie1-Nov-03 20:43
leppie1-Nov-03 20:43 
GeneralRe: For a inherent class, why its events can not be inherented Pin
chq122-Nov-03 4:31
chq122-Nov-03 4:31 
GeneralRe: For a inherent class, why its events can not be inherented Pin
Heath Stewart2-Nov-03 11:05
protectorHeath Stewart2-Nov-03 11:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.