Problems with ItemDataBound event in Datagrid

P

Phil Townsend

I am using the ItemDataBound event of a Datagrid to color code table
cells according to data returned from a SQL stored procedure. At first
everything worked, but then I decided to customize the datagrid by
setting autogenerate columns to 'false' and defining my own column names
(in the aspx page), etc. The ItemDataBound event still fires but I
cannot get it to return the same values. In fact, after writing test
code to examine all of the columns returned, nothing seems to have any
of the same values that the datagrid returns. Any suggestions?
 
S

Scott Allen

Hi Phil,

Are you inspecting the values with code like
e.Item.Cells[x].Controls[y]...?

If so, the indexes can be thrown off depending on the type of column
you are using. Perhaps you could post some code?
 

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

Top