Click here to Skip to main content
15,884,838 members
Home / Discussions / C#
   

C#

 
AnswerRe: Develop Expense Management Tool in C# using ASP.Net Pin
OriginalGriff5-Jan-13 21:21
mveOriginalGriff5-Jan-13 21:21 
AnswerRe: Develop Expense Management Tool in C# using ASP.Net Pin
Abhinav S6-Jan-13 0:04
Abhinav S6-Jan-13 0:04 
QuestionAsk about obfuscating assembly files before creating setup package ? Pin
taibc4-Jan-13 19:37
taibc4-Jan-13 19:37 
QuestionCange datagridview cel backcolor if cel has value Pin
GrooverFromHolland4-Jan-13 9:27
GrooverFromHolland4-Jan-13 9:27 
AnswerRe: Cange datagridview cel backcolor if cel has value Pin
Wendelius4-Jan-13 10:57
mentorWendelius4-Jan-13 10:57 
GeneralRe: Cange datagridview cel backcolor if cel has value Pin
GrooverFromHolland4-Jan-13 11:05
GrooverFromHolland4-Jan-13 11:05 
AnswerRe: Cange datagridview cel backcolor if cel has value Pin
Alan N4-Jan-13 15:09
Alan N4-Jan-13 15:09 
GeneralRe: Cange datagridview cel backcolor if cel has value Pin
GrooverFromHolland5-Jan-13 0:34
GrooverFromHolland5-Jan-13 0:34 
Thanks Alan,

Now I have it for both types in two lines:

C#
private void dataGridViewData_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
       {
           if(e.DesiredType==typeof(string) && (!string.IsNullOrEmpty(e.Value.ToString())))
              e.CellStyle.BackColor = Color.LightGoldenrodYellow;

           if(e.DesiredType==typeof(bool)&&((Convert.ToBoolean(e.Value) == true)))
              e.CellStyle.BackColor = Color.LightGoldenrodYellow;
       }

Edited: I did not test it thorough, if I insert a new row in database I get an exception:
C#
if(e.DesiredType==typeof(bool)&&((Convert.ToBoolean(e.Value) == true)))

Object cannot be cast from DBNull to other types.

Groover,
0200 A9 23
0202 8D 01 80
0205 00

QuestionC# obtain data from file name Pin
classy_dog4-Jan-13 8:24
classy_dog4-Jan-13 8:24 
AnswerRe: C# obtain data from file name Pin
Pete O'Hanlon4-Jan-13 8:59
mvePete O'Hanlon4-Jan-13 8:59 
AnswerRe: C# obtain data from file name Pin
OriginalGriff4-Jan-13 9:50
mveOriginalGriff4-Jan-13 9:50 
GeneralRe: C# obtain data from file name Pin
classy_dog5-Jan-13 10:32
classy_dog5-Jan-13 10:32 
GeneralRe: C# obtain data from file name Pin
OriginalGriff5-Jan-13 11:00
mveOriginalGriff5-Jan-13 11:00 
GeneralRe: C# obtain data from file name Pin
micke.andersson28-Jan-13 4:31
micke.andersson28-Jan-13 4:31 
QuestionExecute a .props file Pin
vanikanc4-Jan-13 8:07
vanikanc4-Jan-13 8:07 
AnswerRe: Execute a .props file Pin
Eddy Vluggen4-Jan-13 22:45
professionalEddy Vluggen4-Jan-13 22:45 
GeneralRe: Execute a .props file Pin
vanikanc7-Jan-13 6:50
vanikanc7-Jan-13 6:50 
AnswerRe: Execute a .props file Pin
Eddy Vluggen7-Jan-13 7:04
professionalEddy Vluggen7-Jan-13 7:04 
GeneralSEHException unhandled Pin
Chris-ahams Njikonye4-Jan-13 6:50
Chris-ahams Njikonye4-Jan-13 6:50 
GeneralRe: SEHException unhandled Pin
Eddy Vluggen4-Jan-13 22:44
professionalEddy Vluggen4-Jan-13 22:44 
GeneralRe: SEHException unhandled Pin
Chris-ahams Njikonye6-Jan-13 23:26
Chris-ahams Njikonye6-Jan-13 23:26 
GeneralRe: SEHException unhandled Pin
Eddy Vluggen6-Jan-13 23:38
professionalEddy Vluggen6-Jan-13 23:38 
GeneralRe: SEHException unhandled Pin
Chris-ahams Njikonye8-Jan-13 3:46
Chris-ahams Njikonye8-Jan-13 3:46 
GeneralRe: SEHException unhandled Pin
Eddy Vluggen9-Jan-13 1:06
professionalEddy Vluggen9-Jan-13 1:06 
QuestionStorage repository Pin
tgarijo4-Jan-13 5:00
tgarijo4-Jan-13 5:00 

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.