![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a WinForm datagrid that receives data from a DataSet. One of the colums is anm INT-column from the database, and I would like to format these INTs before binding them to the control. I format the grid by applying a style to it, and I have seen in the doc that there on the object DataGridTextBoxColumn is a property called .Format, that I have a feeling might be usefull to me. I need to prefix the ints with zeros so that the result is like 210343 -> 210343 123 -> 000123 How you I create a format string that will do this for me? Can you guys give me a hint on this? -- Jesper Stocholm http://stocholm.dk Programmer's code comment: //It probably makes more sense when you're stoned. |
#3
| |||
| |||
|
|
I have a WinForm datagrid that receives data from a DataSet. One of the colums is anm INT-column from the database, and I would like to format these INTs before binding them to the control. I format the grid by applying a style to it, and I have seen in the doc that there on the object DataGridTextBoxColumn is a property called .Format, that I have a feeling might be usefull to me. I need to prefix the ints with zeros so that the result is like 210343 -> 210343 123 -> 000123 How you I create a format string that will do this for me? Can you guys give me a hint on this? -- Jesper Stocholm http://stocholm.dk Programmer's code comment: //It probably makes more sense when you're stoned. |
#4
| |||
| |||
|
|
Jesper, You can use a format of "000000" I believe. It should be interpreted as a custom format, and make sure that six digits are used to represent the value. Hope this helps. |
)
#5
| |||
| |||
|
|
Nicholas Paldino [.NET/C# MVP] wrote: Jesper, You can use a format of "000000" I believe. It should be interpreted as a custom format, and make sure that six digits are used to represent the value. Hope this helps. It did, thank you very much. |
)![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |