accessing datagrid cell

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi all,

Would some one tell me why the value of the e.Item.Cells(index).Text
argument in my datagrid control update event is empty even though I have it
populated? If I want to know a value of a cell in my datagrid control, it it
better to use this expression "MyString =
Ctype(e.Item.cells(index).Controls(0), textbox).text" or this expression
"e.Item.Cells(index).Text"?

If a column of my datagrid control is populated with data but it's not
visible, can is values still be read?

Thank you

Sam
 
You are on the right track but you need to get it in the OnItemDataBound.
Hope that helps
Patrick
 
Sam,

Controls with Visible=false don't get sent to the client and, as a result,
you won't get their values on postback. Use css rule display:none in the
cases when you need the controls on client-side or in postbacks.

Eliyahu
 

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

Back
Top