Click here to Skip to main content
15,902,777 members
Home / Discussions / C#
   

C#

 
AnswerRe: Strange behaviour on C# app in Windows 7... Pin
Dave Kreskowiak27-Jul-12 2:25
mveDave Kreskowiak27-Jul-12 2:25 
GeneralRe: Strange behaviour on C# app in Windows 7... Pin
shiokbarnabas29-Jul-12 22:01
shiokbarnabas29-Jul-12 22:01 
GeneralRe: Strange behaviour on C# app in Windows 7... Pin
Dave Kreskowiak30-Jul-12 1:59
mveDave Kreskowiak30-Jul-12 1:59 
GeneralAccess to the path is denied Pin
Arunkumar.Koloth26-Jul-12 3:35
Arunkumar.Koloth26-Jul-12 3:35 
GeneralRe: Access to the path is denied Pin
Eddy Vluggen26-Jul-12 3:47
professionalEddy Vluggen26-Jul-12 3:47 
GeneralRe: Access to the path is denied Pin
Dave Kreskowiak26-Jul-12 3:51
mveDave Kreskowiak26-Jul-12 3:51 
GeneralRe: Access to the path is denied Pin
Arunkumar.Koloth26-Jul-12 5:17
Arunkumar.Koloth26-Jul-12 5:17 
GeneralRe: Access to the path is denied Pin
dybs26-Jul-12 5:42
dybs26-Jul-12 5:42 
GeneralRe: Access to the path is denied Pin
Arunkumar.Koloth26-Jul-12 5:49
Arunkumar.Koloth26-Jul-12 5:49 
GeneralRe: Access to the path is denied Pin
Dave Kreskowiak26-Jul-12 6:51
mveDave Kreskowiak26-Jul-12 6:51 
GeneralRe: Access to the path is denied Pin
Arunkumar.Koloth26-Jul-12 17:51
Arunkumar.Koloth26-Jul-12 17:51 
GeneralRe: Access to the path is denied Pin
Arunkumar.Koloth27-Jul-12 1:24
Arunkumar.Koloth27-Jul-12 1:24 
GeneralRe: Access to the path is denied Pin
Dave Kreskowiak27-Jul-12 2:08
mveDave Kreskowiak27-Jul-12 2:08 
GeneralRe: Access to the path is denied Pin
ignrod27-Jul-12 1:52
ignrod27-Jul-12 1:52 
GeneralRe: Access to the path is denied Pin
Arunkumar.Koloth27-Jul-12 2:08
Arunkumar.Koloth27-Jul-12 2:08 
GeneralRe: Access to the path is denied Pin
ignrod27-Jul-12 2:36
ignrod27-Jul-12 2:36 
QuestionProblems Running an Executable... Pin
glennPattonWork326-Jul-12 3:08
professionalglennPattonWork326-Jul-12 3:08 
AnswerRe: Problems Running an Executable... Pin
Eddy Vluggen26-Jul-12 3:34
professionalEddy Vluggen26-Jul-12 3:34 
GeneralRe: Problems Running an Executable... Pin
glennPattonWork326-Jul-12 3:42
professionalglennPattonWork326-Jul-12 3:42 
GeneralRe: Problems Running an Executable... Pin
Eddy Vluggen26-Jul-12 6:40
professionalEddy Vluggen26-Jul-12 6:40 
GeneralRe: Problems Running an Executable... Pin
glennPattonWork327-Jul-12 0:17
professionalglennPattonWork327-Jul-12 0:17 
Questioncancelling the dataGridview RowValidating event is not returning me to the grid so i can edit the empty cell Pin
Martin kipth26-Jul-12 1:39
Martin kipth26-Jul-12 1:39 
Iam trying to cancel the RowValidating event in a dataGridview but but after cancelling the event, am not returned to the grid so i can edit the row that was being validated.

In my Grid, if the isCreditSale column value is True and CustomerID column value is Empty, i want to cancel the event, tell the user what the error is, and return the user to the grid so they can edit the row cell values.

Unfortunately, when the messagebox pops up, it never goes away even if you click ok 100 times not until you just terminate the process.

This is the sample code,

C#
private void dataGridView1_RowValidating(object sender, DataGridViewCellCancelEventArgs e)
    {

        if (dataGridView1.Rows[e.RowIndex].IsNewRow)
        {
            return;
        }

            string customer = dataGridView1.Rows[e.RowIndex].Cells["customerID"].FormattedValue.ToString();

            decimal paid;
            decimal.TryParse(dataGridView1.Rows[e.RowIndex].Cells["amountPaid"].FormattedValue.ToString(), out paid);

            bool isCredit;
            bool.TryParse(dataGridView1.Rows[e.RowIndex].Cells["isCreditSale"].FormattedValue.ToString(), out isCredit);

            if (isCredit == true && string.IsNullOrEmpty(customer))
            {
                MessageBox.Show("Please enter a customer name for this credit sale", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.Cancel = true;
            }   
    }

GeneralRe: cancelling the dataGridview RowValidating event is not returning me to the grid so i can edit the empty cell Pin
Senser2226-Jul-12 2:08
Senser2226-Jul-12 2:08 
AnswerRe: cancelling the dataGridview RowValidating event is not returning me to the grid so i can edit the empty cell Pin
Eddy Vluggen26-Jul-12 2:09
professionalEddy Vluggen26-Jul-12 2:09 
QuestionI want to write freehand text in picture box using USB Pen : in pen mode Pin
Shirkeay25-Jul-12 21:40
Shirkeay25-Jul-12 21:40 

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.