Click here to Skip to main content
15,888,984 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: I want to write freehand text in picture box using USB Pen : in pen mode Pin
Richard MacCutchan25-Jul-12 22:29
mveRichard MacCutchan25-Jul-12 22:29 
GeneralRe: I want to write freehand text in picture box using USB Pen : in pen mode Pin
Shirkeay4-Sep-12 23:09
Shirkeay4-Sep-12 23:09 
GeneralRe: I want to write freehand text in picture box using USB Pen : in pen mode Pin
Richard MacCutchan4-Sep-12 23:26
mveRichard MacCutchan4-Sep-12 23:26 
QuestionCPU usage problem when sending udp packets Pin
asghari_mohsen25-Jul-12 10:29
asghari_mohsen25-Jul-12 10:29 
AnswerRe: CPU usage problem when sending udp packets Pin
Dave Kreskowiak25-Jul-12 10:44
mveDave Kreskowiak25-Jul-12 10:44 
GeneralRe: CPU usage problem when sending udp packets Pin
asghari_mohsen25-Jul-12 11:00
asghari_mohsen25-Jul-12 11:00 
QuestionCompare two files Pin
jojoba201125-Jul-12 2:15
jojoba201125-Jul-12 2:15 
AnswerRe: Compare two files Pin
Eddy Vluggen25-Jul-12 2:19
professionalEddy Vluggen25-Jul-12 2:19 
AnswerRe: Compare two files PinPopular
OriginalGriff25-Jul-12 2:55
mveOriginalGriff25-Jul-12 2:55 
GeneralRe: Compare two files Pin
Dave Kreskowiak25-Jul-12 4:08
mveDave Kreskowiak25-Jul-12 4:08 
GeneralRe: Compare two files Pin
Paul Conrad25-Jul-12 17:28
professionalPaul Conrad25-Jul-12 17:28 
GeneralRe: Compare two files Pin
OriginalGriff25-Jul-12 19:31
mveOriginalGriff25-Jul-12 19:31 
AnswerRe: Compare two files Pin
PIEBALDconsult25-Jul-12 3:32
mvePIEBALDconsult25-Jul-12 3:32 
AnswerRe: Compare two files Pin
jojoba201125-Jul-12 17:58
jojoba201125-Jul-12 17: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.