Click here to Skip to main content
15,030,322 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
Pete O'Hanlon12-Apr-12 5:05
mvePete O'Hanlon12-Apr-12 5:05 
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
harvid12-Apr-12 5:18
Memberharvid12-Apr-12 5:18 
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
Pete O'Hanlon12-Apr-12 5:51
mvePete O'Hanlon12-Apr-12 5:51 
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
harvid12-Apr-12 21:38
Memberharvid12-Apr-12 21:38 
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
Pete O'Hanlon12-Apr-12 22:10
mvePete O'Hanlon12-Apr-12 22:10 
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
harvid12-Apr-12 23:17
Memberharvid12-Apr-12 23:17 
AnswerRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
Luc Pattyn13-Apr-12 1:58
sitebuilderLuc Pattyn13-Apr-12 1:58 
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
harvid13-Apr-12 3:05
Memberharvid13-Apr-12 3:05 
If dgEditor.Columns(e.ColumnIndex).Name = "Status" Then
If dgEditor.Rows(e.RowIndex).Cells("Status").Value = "NEW" Then
'if already marked as new, leave it alone
If IsDBNull(dgEditor.Rows(e.RowIndex).Cells("CommonLineName").Value) Then
Else
If dgEditor.Rows(e.RowIndex).Cells("CommonLineName").Value <> "" Then
e.CellStyle.SelectionForeColor = Color.DarkGreen
e.CellStyle.ForeColor = Color.DarkGreen
e.CellStyle.BackColor = Color.Orange
e.CellStyle.SelectionBackColor = Color.Orange
End If
End If
Else
If dgEditor.Rows(e.RowIndex).Cells("UsedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Used"
e.CellStyle.BackColor = Color.LightGreen
e.CellStyle.SelectionBackColor = Color.LightGreen
e.CellStyle.SelectionForeColor = Color.Black
Else
If dgEditor.Rows(e.RowIndex).Cells("ExpiredFlag").Value = 1 Then
If dgEditor.Rows(e.RowIndex).Cells("ApprovedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "UnUsed" 'approved expired
e.CellStyle.BackColor = Color.LightGray
e.CellStyle.SelectionBackColor = Color.LightGray
Else
If dgEditor.Rows(e.RowIndex).Cells("RejectedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Expired" 'Rejected expired
e.CellStyle.BackColor = Color.LightCoral
e.CellStyle.SelectionBackColor = Color.LightCoral
Else
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Expired" 'pure expired - never approved and never rejected
e.CellStyle.BackColor = Color.Gray
e.CellStyle.SelectionBackColor = Color.Gray
End If
End If
Else
If dgEditor.Rows(e.RowIndex).Cells("RejectedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Rejected"
e.CellStyle.BackColor = Color.Red
e.CellStyle.SelectionBackColor = Color.Red
Else
If dgEditor.Rows(e.RowIndex).Cells("ApprovedFlag").Value = 1 Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Approved"
e.CellStyle.BackColor = Color.Green
e.CellStyle.SelectionBackColor = Color.Green
Else
If dgEditor.Rows(e.RowIndex).IsNewRow = True Then
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "NEW"
e.CellStyle.SelectionForeColor = Color.DarkGreen
e.CellStyle.ForeColor = Color.DarkGreen
e.CellStyle.BackColor = Color.HotPink
e.CellStyle.SelectionBackColor = Color.HotPink
Else
If dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Edited" Then
e.CellStyle.SelectionForeColor = Color.DarkGreen
e.CellStyle.ForeColor = Color.DarkGreen
e.CellStyle.BackColor = Color.HotPink
e.CellStyle.SelectionBackColor = Color.HotPink
Else
dgEditor.Rows(e.RowIndex).Cells("Status").Value = "Pending"
e.CellStyle.SelectionForeColor = Color.Black
e.CellStyle.BackColor = Color.Yellow
e.CellStyle.SelectionBackColor = Color.Yellow
End If
End If
End If
End If
End If
End If
End If

'Application.DoEvents()
End If



Above lines are in my Cell formatting event. I have commented out Application.DoEvents as it was causing some issue.

Could you please elaborate how i can proceed with
if (Something!=theValueIWant) Something=theValueIWant;
.That would be much helpful.
AnswerRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
Luc Pattyn13-Apr-12 3:57
sitebuilderLuc Pattyn13-Apr-12 3:57 
GeneralRe: Datagridview cell not updating in Windows 2008 SP2 server Pin
harvid16-Apr-12 3:01
Memberharvid16-Apr-12 3:01 
Question.... Pin
Arul R Ece10-Apr-12 23:42
MemberArul R Ece10-Apr-12 23:42 
GeneralRe: earthquake Pin
Pete O'Hanlon11-Apr-12 0:15
mvePete O'Hanlon11-Apr-12 0:15 
QuestionQuestion related to Windows Form Pin
Shikha Rani10-Apr-12 19:29
MemberShikha Rani10-Apr-12 19:29 
AnswerRe: Question related to Windows Form Pin
Abhinav S10-Apr-12 19:40
MemberAbhinav S10-Apr-12 19:40 
AnswerRe: Any suggestions about barcode generation? Pin
Richard MacCutchan14-Mar-12 1:25
mveRichard MacCutchan14-Mar-12 1:25 
QuestionDo any ad platforms exist for desktop apps? Pin
jeffb422-Mar-12 8:47
Memberjeffb422-Mar-12 8:47 
AnswerRe: Do any ad platforms exist for desktop apps? Pin
Dave Kreskowiak2-Mar-12 12:42
mveDave Kreskowiak2-Mar-12 12:42 
GeneralRe: Do any ad platforms exist for desktop apps? Pin
jeffb422-Mar-12 13:13
Memberjeffb422-Mar-12 13:13 
GeneralRe: Do any ad platforms exist for desktop apps? Pin
Dave Kreskowiak2-Mar-12 13:40
mveDave Kreskowiak2-Mar-12 13:40 
Question[VC++] Getting mouse position Pin
kctong5292-Mar-12 1:43
Memberkctong5292-Mar-12 1:43 
AnswerRe: [VC++] Getting mouse position Pin
Richard MacCutchan2-Mar-12 2:26
mveRichard MacCutchan2-Mar-12 2:26 
Questioni prefer vb.net Pin
isaacleye29-Feb-12 20:18
Memberisaacleye29-Feb-12 20:18 
AnswerRe: i prefer vb.net Pin
Pete O'Hanlon29-Feb-12 21:56
mvePete O'Hanlon29-Feb-12 21:56 
AnswerRe: i prefer vb.net Pin
Simon_Whale29-Feb-12 22:04
professionalSimon_Whale29-Feb-12 22:04 
AnswerRe: i prefer vb.net Pin
Abhinav S29-Feb-12 22:13
MemberAbhinav S29-Feb-12 22:13 

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.