Is it possible to set the DataFormatString property of a column or cell in an ASP.NET DataGridView at runtime?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Carriage Return (ASCII chr 13) is missing from tex
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
Not that I know of, you might want to try peforming the column formatting on RowDataBound event though might have some performance degrade. Will be glad if someone can provide a simpler method.
There doesn't seem to be a way to set the DataFormatString property. I have ended up binding the datasource to the table and then going through all the cells and formatting them manually:
This method works perfectly for me. Not sure how it would scale up with a large dataset although my guess is it would be fine.
This should work.
Found via http://geekswithblogs.net/michelotti/archive/2006/03/30/73896.aspx