Click here to Skip to main content
15,901,373 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I compare two points in C#? Pin
wout de zeeuw16-Jan-07 5:46
wout de zeeuw16-Jan-07 5:46 
AnswerRe: How can I compare two points in C#? Pin
davidc2p16-Jan-07 5:04
davidc2p16-Jan-07 5:04 
AnswerRe: How can I compare two points in C#? Pin
Luc Pattyn16-Jan-07 5:50
sitebuilderLuc Pattyn16-Jan-07 5:50 
QuestionEstablishing Relationship with tables in SQL Server 2000 Pin
Banjo Ayorinde16-Jan-07 4:33
Banjo Ayorinde16-Jan-07 4:33 
AnswerRe: Establishing Relationship with tables in SQL Server 2000 Pin
Colin Angus Mackay16-Jan-07 4:47
Colin Angus Mackay16-Jan-07 4:47 
QuestionCreating Report with Crystal Report based on SQL 2000 Pin
Banjo Ayorinde16-Jan-07 4:26
Banjo Ayorinde16-Jan-07 4:26 
Questionvisual style Pin
fmardani16-Jan-07 4:26
fmardani16-Jan-07 4:26 
QuestionBindingSource with Combo - how to clear the combo intiailly Pin
Umair Ahmad16-Jan-07 4:22
Umair Ahmad16-Jan-07 4:22 
I have a fairly standard forms-based application with a lot of data-bound combos (DropDownList style) in it. Everything works fine except when the form is used to edit a 'new' object. In that case, all the form fields should be cleared. But combos dont show in cleared state, they just keep displaying the first value in the list. So now the user thinks that a value is already selected for him, but the application doesnt actually update the bound property of the object unless some other value is selected in the combo.

Lets say I have these two classes in my app.
<br />
class SelItem<br />
{<br />
   public string Id { get; set; }<br />
}<br />
<br />
class MyObj<br />
{<br />
   public SelItem Selection { get; set; }<br />
}<br />


To fill the drop down list of the combo i use (Id is a string property of the objects im passing through valuesList):
<br />
combo.DisplayMember = "Id";<br />
combo.DataSource = valuesList;   // an array of SelItem<br />


and using the forms designer I've bound the Text & SelectedValue of the combobox in this way (bindingSource contains a list of MyObj):
<br />
combo.DataBindings.Add(new System.Windows.Forms.Binding("SelectedValue", bindingSource, "Selection", true));<br />
combo.DataBindings.Add(new System.Windows.Forms.Binding("Text", bindingSource, "Selection.Id", true));<br />


Currently, I'm clearing the combo-boxes by setting their SelectedIndex property to -1 every time a 'new' form is launched, but thats just a hack. Anyone got an idea why isnt the combo taking care of this automatically.
QuestionAccess Remote Registry using WMI:StdRegProv Pin
Parrish16-Jan-07 4:14
Parrish16-Jan-07 4:14 
Questioncan't access object in finally-block [solved] Pin
Drum D.16-Jan-07 3:58
Drum D.16-Jan-07 3:58 
AnswerRe: can't access object in finally-block Pin
Pete O'Hanlon16-Jan-07 4:17
mvePete O'Hanlon16-Jan-07 4:17 
AnswerRe: can't access object in finally-block Pin
J4amieC16-Jan-07 5:09
J4amieC16-Jan-07 5:09 
AnswerRe: can't access object in finally-block Pin
Drum D.16-Jan-07 7:33
Drum D.16-Jan-07 7:33 
QuestionScope_identity() doesn't work Pin
cruscotto16-Jan-07 3:45
cruscotto16-Jan-07 3:45 
AnswerRe: Scope_identity() doesn't work Pin
Dave Kreskowiak16-Jan-07 5:51
mveDave Kreskowiak16-Jan-07 5:51 
GeneralRe: Scope_identity() doesn't work Pin
cruscotto16-Jan-07 6:08
cruscotto16-Jan-07 6:08 
GeneralRe: Scope_identity() doesn't work Pin
Dave Kreskowiak16-Jan-07 8:06
mveDave Kreskowiak16-Jan-07 8:06 
Questionhelp!! replace string Pin
vanudu16-Jan-07 3:42
vanudu16-Jan-07 3:42 
AnswerRe: help!! replace string Pin
Pete O'Hanlon16-Jan-07 3:47
mvePete O'Hanlon16-Jan-07 3:47 
GeneralRe: help!! replace string Pin
vanudu16-Jan-07 3:48
vanudu16-Jan-07 3:48 
GeneralRe: help!! replace string Pin
Pete O'Hanlon16-Jan-07 3:56
mvePete O'Hanlon16-Jan-07 3:56 
GeneralRe: help!! replace string Pin
vanudu16-Jan-07 4:02
vanudu16-Jan-07 4:02 
GeneralRe: help!! replace string Pin
Pete O'Hanlon16-Jan-07 4:15
mvePete O'Hanlon16-Jan-07 4:15 
AnswerRe: help!! replace string Pin
Seishin#16-Jan-07 3:49
Seishin#16-Jan-07 3:49 
GeneralRe: help!! replace string Pin
vanudu16-Jan-07 3:58
vanudu16-Jan-07 3:58 

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.