Datagrid Format Question

  • Thread starter Thread starter aaapaul
  • Start date Start date
A

aaapaul

Hello !

I have a Datagrid with .AutoGenerateColumns = True

Colums 1 to X should have the same format.

In which event can I set the format ?

For i = 0 to dg.columns.count -1
dg.columns(i).dataformatstring = "{0:#,##0}"
next

Thanks
aaapaul
 
The only event where you can catch autogenerated columns is ItemCreated.
Don't use Columns property, the event will be called once for every item.

Eliyahu
 
Back
Top