Groups | Blog | Home
all groups > asp.net > april 2006 >

asp.net : accessing datagrid cell


Sam
4/1/2006 11:35:57 PM
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

Patrick.O.Ige
4/2/2006 12:00:00 AM
You are on the right track but you need to get it in the OnItemDataBound.
Hope that helps
Patrick


[quoted text, click to view]

Eliyahu Goldin
4/2/2006 12:00:00 AM
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

[quoted text, click to view]

Sam
4/2/2006 5:50:29 PM
It helps. Thanks for the tips guys

Regards,
Sam

[quoted text, click to view]

AddThis Social Bookmark Button