Click here to Skip to main content
15,920,217 members
Home / Discussions / C#
   

C#

 
Generalconvert XML to HTML Pin
marky7777-Feb-08 19:51
marky7777-Feb-08 19:51 
GeneralRe: convert XML to HTML Pin
Joachim Kerschbaumer7-Feb-08 20:41
Joachim Kerschbaumer7-Feb-08 20:41 
Generalembed cursor Pin
Try7-Feb-08 19:10
Try7-Feb-08 19:10 
AnswerRe: embed cursor Pin
Vikram A Punathambekar7-Feb-08 19:33
Vikram A Punathambekar7-Feb-08 19:33 
GeneralRe: embed cursor Pin
Try7-Feb-08 20:04
Try7-Feb-08 20:04 
GeneralRe: embed cursor Pin
Try7-Feb-08 21:05
Try7-Feb-08 21:05 
GeneralMYOB Pin
the_smiths7-Feb-08 19:05
the_smiths7-Feb-08 19:05 
QuestiontoolStrip bug? Pin
Harvey Saayman7-Feb-08 19:04
Harvey Saayman7-Feb-08 19:04 
hey there

i hav a lil problem with a toolStripButton
the following code is in my app

<br />
private void BtnSave_Click(object sender, EventArgs e)<br />
        {<br />
            method();<br />
        }<br />
<br />
        private void dataGridView_CellEndEdit(object sender, DataGridViewCellEventArgs e)<br />
        {<br />
            save = true;<br />
        }<br />
<br />
        private void FrmTimeCategories_FormClosing(object sender, FormClosingEventArgs e)<br />
        {<br />
            if (save)<br />
            {<br />
                string option = MessageBox.Show("Would You Like To Save The Changes?", "Question", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question).ToString();<br />
<br />
                if (option == "Yes")<br />
                {<br />
                    method();<br />
                }<br />
                else if (option == "No")<br />
                {<br />
                    MessageBox.Show("Changes Will Be Lost");<br />
                }<br />
                else if (option == "Cancel")<br />
                {<br />
                    e.Cancel = true;<br />
                }<br />
            }<br />
            save = false;<br />
        }<br />
<br />
        private void btnDeleteRow_Click(object sender, EventArgs e)<br />
        {<br />
            foreach (DataGridViewRow row in dataGridView.SelectedRows)<br />
            {<br />
                TimeCatTable.Rows[row.Index].Delete();<br />
            }<br />
            <br />
            TimeCatTable.AcceptChanges();<br />
            SqlCommandBuilder sqlBuilder = new SqlCommandBuilder(dataAdapter);<br />
            dataAdapter.Update(dataSet, "TimeCat");<br />
        }<br />
<br />
        public void method()<br />
        {<br />
            SqlCommandBuilder sqlBuilder = new SqlCommandBuilder(dataAdapter);<br />
            dataAdapter.Update(dataSet, "TimeCat");<br />
<br />
            save = false;<br />
        }<br />


now the problem is this... the call to method() doens work in the toolstripbutton (btnSave) click handler. the program defenetly goes into it (i put a messagebox in to test that) but its doesnt save the changes to my database, but the method() in the formClosing handler does save it!

i put a normal button on the form aswell just to see and that worked too... im confused with this.

can anyone plz tell me why this happens?

Think big and kick ass

GeneralRe: toolStrip bug? Pin
Gareth H7-Feb-08 22:45
Gareth H7-Feb-08 22:45 
GeneralRe: toolStrip bug? Pin
Harvey Saayman7-Feb-08 23:40
Harvey Saayman7-Feb-08 23:40 
GeneralMove drawing and Copy Drawing in a Drawing Editor Pin
a_david1237-Feb-08 18:45
a_david1237-Feb-08 18:45 
QuestionDos command Pin
Smithakrishnan7-Feb-08 18:33
Smithakrishnan7-Feb-08 18:33 
GeneralRe: Dos command Pin
Joachim Kerschbaumer7-Feb-08 20:36
Joachim Kerschbaumer7-Feb-08 20:36 
QuestionHow to make this code to debug.... Pin
NarVish7-Feb-08 17:39
NarVish7-Feb-08 17:39 
AnswerRe: How to make this code to debug.... Pin
Vikram A Punathambekar7-Feb-08 18:28
Vikram A Punathambekar7-Feb-08 18:28 
QuestionHow to validate system's user account and password? Pin
Sutheesh7-Feb-08 16:37
Sutheesh7-Feb-08 16:37 
GeneralInput Class (XNA) Pin
MasterSharp7-Feb-08 16:34
MasterSharp7-Feb-08 16:34 
GeneralRe: Input Class (XNA) Pin
User 66587-Feb-08 23:16
User 66587-Feb-08 23:16 
GeneralUse mutex to find the multiple instance Pin
CodingLover7-Feb-08 15:22
CodingLover7-Feb-08 15:22 
GeneralRe: Use mutex to find the multiple instance Pin
Vikram A Punathambekar7-Feb-08 18:40
Vikram A Punathambekar7-Feb-08 18:40 
GeneralActive Directory time limit Pin
robot_rock7-Feb-08 14:31
robot_rock7-Feb-08 14:31 
GeneralRe: Active Directory time limit Pin
Ennis Ray Lynch, Jr.7-Feb-08 15:56
Ennis Ray Lynch, Jr.7-Feb-08 15:56 
GeneralRe: Active Directory time limit Pin
robot_rock7-Feb-08 22:14
robot_rock7-Feb-08 22:14 
GeneralTreeview Node Select Problem Pin
Rick van Woudenberg7-Feb-08 13:04
Rick van Woudenberg7-Feb-08 13:04 
GeneralRe: Treeview Node Select Problem Pin
Christian Graus7-Feb-08 13:06
protectorChristian Graus7-Feb-08 13:06 

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.