Access CheckBox in DataGrid ItemTemplate

G

Guest

I wish to access CheckBox control in ItemTemplate, to set or get value.
I use next code on event: ItemDataBound(...)
//-------------
e.Item.Cells[0].FindControl("CheckBox1")
//-------------
to access desired checkbox.

Is there exist some faster way to access this control then method
FindControl().
Maybe something like: e.Item.Cells[0].Controls[0], to access control
directly from index.

Thanks
 
E

Eliyahu Goldin

Yes, if you know the index you can use e.Item.Cells[0].Controls. I am not
sure if it will affect the application performance in any way though.

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

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top