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

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -