Easier way to access a Datagrid Dataitem?

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
 
S

Srinivas

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top