Easier way to access a Datagrid Dataitem?

  • Thread starter Thread starter Raterus
  • Start date Start date
R

Raterus

Hi,

I'm using a datagrid, and the sub ItemDataBound to customize output of my
datagrid when it is bound. Is the only way I can access the data in my
datasource is to use

DataBinder.Eval(e.Item.DataItem, "myFieldName")

It just seems to be a little clunky to have to use this for every varible in
my datasource, even more when using "option strict" you have to cast the
result, making for an even longer statement. This isn't that much of a
problem, i'm just wondering if i'm missing something that would be much
easier.

Thanks,
--Michael
 
After the datagrid is bound you can loop through and format the items

e.g datagrid.items(0).cells(0).text

Hope this helps

Srinivas
 
Back
Top