Click here to Skip to main content
15,890,506 members
Home / Discussions / C#
   

C#

 
Questionproblem with List and FindAll() Pin
dfn14-Jun-07 17:59
dfn14-Jun-07 17:59 
AnswerRe: problem with List and FindAll() Pin
Christian Graus14-Jun-07 18:11
protectorChristian Graus14-Jun-07 18:11 
AnswerRe: problem with List and FindAll() Pin
Expert Coming14-Jun-07 18:14
Expert Coming14-Jun-07 18:14 
AnswerRe: problem with List and FindAll() Pin
dfn15-Jun-07 18:03
dfn15-Jun-07 18:03 
QuestionObjectDataSource ID Pin
Expert Coming14-Jun-07 17:43
Expert Coming14-Jun-07 17:43 
QuestionRe: ObjectDataSource ID Pin
RepliCrux14-Jun-07 19:10
RepliCrux14-Jun-07 19:10 
AnswerRe: ObjectDataSource ID Pin
Expert Coming14-Jun-07 19:13
Expert Coming14-Jun-07 19:13 
QuestionAutoSave change in databound comboBox Pin
Glen Harvy14-Jun-07 17:31
Glen Harvy14-Jun-07 17:31 
Hi,

This should be easy but I can't work it out (nor follow the logic).

I have a comboBox that has its text bound to a field in a datatable. The items in the dropdown list are hard coded.

I have a Save button that has the following on_click event:
<br />
      try<br />
      {<br />
        this.configBindingSource.EndEdit();<br />
        this.configTableAdapter.Update(this.myWebDataSet.Config);<br />
        this.myWebDataSet.AcceptChanges();<br />
        MessageBox.Show("Changes recorded successfully.", "Information Only", MessageBoxButtons.OK, MessageBoxIcon.Information);<br />
        setLogLevel();<br />
        logger.Info("SaveButton_Saved");<br />
      }<br />
      catch (Exception ex)<br />
      {<br />
        MessageBox.Show("Unable to record the change.\nPlease try again.\nSee log file for details.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);<br />
        logger.ErrorException("SaveButton_Failed", ex);<br />
      }


Any changes in the comboBox are succesfully saved when the Save button is clicked.

There are no other databound controls on the form.

What I wish to do is eliminate the Save button and have the above events inside the Save click take place automatically. I thought I could just move the Save button events into the comboBox's SelectionChangedCommitted event but this doesn't save the changes back to the datatable/database. I even tried putting tsButtonSave.PerformClick() into the comboBox's event but that doesn't work either.

Can someone help me with the solution and perhaps explain to me where my logic is flawed.

Thanks.



Glen Harvy

GeneralRe: AutoSave change in databound comboBox Pin
Martin#14-Jun-07 21:37
Martin#14-Jun-07 21:37 
Questionspecial characters are coming in XML output Pin
saymajum14-Jun-07 17:14
saymajum14-Jun-07 17:14 
AnswerRe: special characters are coming in XML output Pin
Christian Graus14-Jun-07 17:31
protectorChristian Graus14-Jun-07 17:31 
GeneralRe: special characters are coming in XML output Pin
saymajum14-Jun-07 19:24
saymajum14-Jun-07 19:24 
QuestionA qustion on Dll Call Pin
Xiaoming Qian14-Jun-07 15:16
Xiaoming Qian14-Jun-07 15:16 
AnswerRe: A qustion on Dll Call Pin
Tarakeshwar Reddy14-Jun-07 17:03
professionalTarakeshwar Reddy14-Jun-07 17:03 
GeneralRe: A qustion on Dll Call Pin
Xiaoming Qian14-Jun-07 20:41
Xiaoming Qian14-Jun-07 20:41 
Questionhow to put a Button Image into an array? Pin
Khoramdin14-Jun-07 14:38
Khoramdin14-Jun-07 14:38 
AnswerRe: how to put a Button Image into an array? Pin
alexey N14-Jun-07 18:44
alexey N14-Jun-07 18:44 
QuestionConvert Large Icons into Small???? Pin
classNoob14-Jun-07 13:29
classNoob14-Jun-07 13:29 
QuestionUsing your own classes in methods. Pin
jblouir14-Jun-07 12:32
jblouir14-Jun-07 12:32 
AnswerRe: Using your own classes in methods. Pin
Guffa14-Jun-07 12:55
Guffa14-Jun-07 12:55 
GeneralRe: Using your own classes in methods. Pin
jblouir14-Jun-07 13:05
jblouir14-Jun-07 13:05 
GeneralRe: Using your own classes in methods. Pin
jblouir14-Jun-07 13:26
jblouir14-Jun-07 13:26 
GeneralWell... Pin
jblouir14-Jun-07 13:31
jblouir14-Jun-07 13:31 
GeneralRe: Well... Pin
jblouir14-Jun-07 13:37
jblouir14-Jun-07 13:37 
GeneralRe: Well... Pin
jblouir14-Jun-07 13:47
jblouir14-Jun-07 13:47 

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.