all groups > asp.net datagrid control > october 2003 >
You're in the

asp.net datagrid control

group:

Updating DataFormatString programmatically



Updating DataFormatString programmatically Cathie
10/30/2003 6:11:26 PM
asp.net datagrid control: Hi All,

I have a situation where I read a string format from a resource file. I
would like this format to be used to format a BoundColumn in the datagrid
I'm displaying. Can I update the DataFormatString at run-time? If so how?

Thanks in advance,
Cathie

Re: Updating DataFormatString programmatically Giorgio Parmeggiani
11/1/2003 5:40:42 PM
Hi

[quoted text, click to view]

At runtime, for example in the Page_Load event, you can use the
BoundColumn.DataFormatString property to modify the format of the bound
column.

A little example:

((BoundColumn)this.DataGrid1.Columns[1]).DataFormatString = <your format
string>

Hi
Giorgio

AddThis Social Bookmark Button