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 -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -