Click here to Skip to main content
15,913,610 members
Home / Discussions / C#
   

C#

 
Questionnew in this industry Pin
benson.misi21-Apr-09 21:42
benson.misi21-Apr-09 21:42 
AnswerRe: new in this industry Pin
Mbah Dhaim21-Apr-09 21:58
Mbah Dhaim21-Apr-09 21:58 
QuestionHow to capture the Windows XP backgournd to gray? (.NET Framework 3.0) Pin
CooperWu21-Apr-09 21:16
CooperWu21-Apr-09 21:16 
QuestionHow i can istall my first project... Pin
VisualLive21-Apr-09 21:13
VisualLive21-Apr-09 21:13 
AnswerRe: How i can istall my first project... Pin
SeMartens21-Apr-09 21:27
SeMartens21-Apr-09 21:27 
GeneralRe: How i can istall my first project... Pin
VisualLive21-Apr-09 21:55
VisualLive21-Apr-09 21:55 
GeneralRe: How i can istall my first project... Pin
SeMartens21-Apr-09 23:41
SeMartens21-Apr-09 23:41 
GeneralRe: How i can istall my first project... Pin
VisualLive22-Apr-09 6:00
VisualLive22-Apr-09 6:00 
GeneralRe: How i can istall my first project... Pin
VisualLive6-May-09 15:43
VisualLive6-May-09 15:43 
QuestionClickable Link Pin
satsumatable21-Apr-09 20:31
satsumatable21-Apr-09 20:31 
AnswerRe: Clickable Link Pin
zk11322991721-Apr-09 20:37
zk11322991721-Apr-09 20:37 
Questionhttp://www.codeproject.com/KB/list/treelistview.aspx Pin
hirenkshah21-Apr-09 19:36
hirenkshah21-Apr-09 19:36 
QuestionExcel: change cell color of unprotect sheet using macro. Pin
hirenkshah21-Apr-09 19:15
hirenkshah21-Apr-09 19:15 
QuestionView PDF file in winform Pin
aldo hexosa21-Apr-09 18:54
professionalaldo hexosa21-Apr-09 18:54 
AnswerRe: View PDF file in winform Pin
Giorgi Dalakishvili21-Apr-09 19:39
mentorGiorgi Dalakishvili21-Apr-09 19:39 
QuestionWriting correct code Pin
Akhilesh Yadav21-Apr-09 18:45
Akhilesh Yadav21-Apr-09 18:45 
AnswerRe: Writing correct code Pin
Perry Holman21-Apr-09 19:30
Perry Holman21-Apr-09 19:30 
GeneralRe: Writing correct code Pin
Akhilesh Yadav21-Apr-09 19:32
Akhilesh Yadav21-Apr-09 19:32 
GeneralRe: Writing correct code Pin
Mycroft Holmes21-Apr-09 20:18
professionalMycroft Holmes21-Apr-09 20:18 
AnswerRe: Writing correct code Pin
Thomas Weller21-Apr-09 20:49
Thomas Weller21-Apr-09 20:49 
Try this:

DataGridView grid = new DataGridView();

foreach(string colName in ColumnNames)
{
    grid.Columns.Add(
            ([condition]) ?
                new DataGridViewColumn() :
                new MyColumn());
} 


And btw: Don't care about performance at all, as long as you have no hard evidence (i.e. measures or customer complaints) about it. During development, you should only care about the correct functioning, behaviour and readability of your code. Use unit tests to reliably assure this.

Regards
Thomas

www.thomas-weller.de

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Programmer - an organism that turns coffee into software.


AnswerRe: Writing correct code Pin
Luc Pattyn22-Apr-09 4:39
sitebuilderLuc Pattyn22-Apr-09 4:39 
QuestionDatagridView Column Re-ordering Pin
codeprasanna21-Apr-09 18:44
codeprasanna21-Apr-09 18:44 
AnswerRe: DatagridView Column Re-ordering Pin
Mycroft Holmes21-Apr-09 20:16
professionalMycroft Holmes21-Apr-09 20:16 
QuestionFtp Linux Command in .Net Pin
Abdul Rahman Hamidy21-Apr-09 18:02
Abdul Rahman Hamidy21-Apr-09 18:02 
AnswerRe: Ftp Linux Command in .Net Pin
blackjack215023-Apr-09 2:57
blackjack215023-Apr-09 2:57 

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.