c# - Why can't I use format specifier on DataGrid Value? -


string foo = selectedrow.cells["foo"].value.tostring("d5");  

gives me error of

no overload method 'tostring' takes 1 arguments 

so had use

string foo = selectedrow.cells["foo"].value.tostring().padleft(5,'0'); 

anyone can explain why?

datagridviewcell.value of type system.object. object.tostring() method not take arguments. therefore, cannot provide format specifier.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

asp.net - Configuring WCF Services in Code WCF 4.5 -