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

C#

 
QuestionDatagridview Sort By number Pin
mohammadkaab10-Sep-12 21:52
mohammadkaab10-Sep-12 21:52 
AnswerRe: Datagridview Sort By number Pin
Mycroft Holmes10-Sep-12 22:00
professionalMycroft Holmes10-Sep-12 22:00 
GeneralRe: Datagridview Sort By number Pin
mohammadkaab10-Sep-12 22:05
mohammadkaab10-Sep-12 22:05 
GeneralRe: Datagridview Sort By number Pin
Pete O'Hanlon10-Sep-12 22:19
mvePete O'Hanlon10-Sep-12 22:19 
GeneralRe: Datagridview Sort By number Pin
Mycroft Holmes10-Sep-12 22:38
professionalMycroft Holmes10-Sep-12 22:38 
QuestionConstructor in static class Pin
amit@iadept10-Sep-12 20:20
amit@iadept10-Sep-12 20:20 
AnswerRe: Constructor in static class Pin
Wayne Gaylard10-Sep-12 20:59
professionalWayne Gaylard10-Sep-12 20:59 
AnswerRe: Constructor in static class Pin
BobJanova11-Sep-12 0:21
BobJanova11-Sep-12 0:21 
No. How would you call it? Static constructors are called by the framework at a time which your code can't know*, and without any parameters. In fact the same construct in Java makes this clearer by just being

static {
 // code
}


... so it doesn't look like a callable method (which it isn't).

(*: It's called the first time the class is fully loaded, which I think happens when a method/field/property is called. However, you still don't know when that is because some other code might use the same class.)

If you want to preload state then you can have a parameter-accepting normal static method which you call in the Main procedure or via a static constructor elsewhere. (Obviously, you could call it from anywhere, but you want to call it before you are going to use the class at all, and Main is about the only place you can guarantee that.)
AnswerRe: Constructor in static class Pin
PIEBALDconsult11-Sep-12 3:20
mvePIEBALDconsult11-Sep-12 3:20 
AnswerRe: Constructor in static class Pin
Abhinav S11-Sep-12 7:52
Abhinav S11-Sep-12 7:52 
JokeRe: Constructor in static class Pin
Pete O'Hanlon11-Sep-12 8:04
mvePete O'Hanlon11-Sep-12 8:04 
AnswerRe: Constructor in static class Pin
Clifford Nelson11-Sep-12 8:04
Clifford Nelson11-Sep-12 8:04 
Questionpopulate textbox in selectedindexchangeevent Pin
tonyalex00110-Sep-12 20:08
tonyalex00110-Sep-12 20:08 
QuestionRe: populate textbox in selectedindexchangeevent Pin
Wayne Gaylard10-Sep-12 21:01
professionalWayne Gaylard10-Sep-12 21:01 
AnswerRe: populate textbox in selectedindexchangeevent Pin
Bernhard Hiller10-Sep-12 22:00
Bernhard Hiller10-Sep-12 22:00 
QuestionWindows Login Box Pin
mamoony10-Sep-12 10:45
mamoony10-Sep-12 10:45 
AnswerRe: Windows Login Box Pin
Michael_Lu10-Sep-12 11:18
Michael_Lu10-Sep-12 11:18 
GeneralRe: Windows Login Box Pin
mamoony11-Sep-12 2:39
mamoony11-Sep-12 2:39 
AnswerRe: Windows Login Box Pin
Abhinav S10-Sep-12 17:35
Abhinav S10-Sep-12 17:35 
GeneralRe: Windows Login Box Pin
mamoony11-Sep-12 2:43
mamoony11-Sep-12 2:43 
QuestionWeb Service Stack trace .. Pin
UBX10-Sep-12 4:02
UBX10-Sep-12 4:02 
AnswerRe: Web Service Stack trace .. Pin
Dave Kreskowiak10-Sep-12 5:57
mveDave Kreskowiak10-Sep-12 5:57 
GeneralRe: Web Service Stack trace .. Pin
BobJanova11-Sep-12 0:23
BobJanova11-Sep-12 0:23 
GeneralRe: Web Service Stack trace .. Pin
Pete O'Hanlon11-Sep-12 0:36
mvePete O'Hanlon11-Sep-12 0:36 
GeneralRe: Web Service Stack trace .. Pin
BobJanova11-Sep-12 0:44
BobJanova11-Sep-12 0:44 

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.