Problem with ItemDataBound / ItemCreate (text seems to be empty)

G

Gabriël

Hi All,

I've created an eventhandler for ItemdataBound and ItemCreated, but when I
access "e.Item.Cells[0].Text" it's always empty. BUT, when I assign a value
to this empty field (while being in debug mode, via the Command Window) it
DOES show up in the page that's been rendered. So I CAN assign but CANNOT
access the data.

Any suggestions?

Greets,
Gab
 
G

Gabriël

private void dataGridMain_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)

{

if ((e.Item.ItemType == ListItemType.Item) || ( e.Item.ItemType ==
ListItemType.AlternatingItem))

{

if (e.Item.Cells[1].Text != string.Empty)

{

(...)

}

}

}
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top