Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Access CheckBox in DataGrid ItemTemplate

Reply
Thread Tools

Access CheckBox in DataGrid ItemTemplate

 
 
=?Utf-8?B?TWlsYW5C?=
Guest
Posts: n/a
 
      07-19-2005
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


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      07-19-2005
Yes, if you know the index you can use e.Item.Cells[0].Controls[i]. I am not
sure if it will affect the application performance in any way though.

Eliyahu

"MilanB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox in ItemTemplate David C ASP .Net 1 11-30-2009 09:16 PM
gridview-template-itemtemplate-checkbox keerts23 ASP .Net 0 07-29-2009 06:56 PM
Loading Itemtemplate with CheckBox dynamically in Gridview dean wilson ASP .Net Web Controls 0 07-20-2005 03:00 PM
can code inside a Repeater's ItemTemplate modify controls in the ItemTemplate? Bennett Haselton ASP .Net 1 09-24-2004 01:59 AM
CheckBox in Datalist ItemTemplate Sung ASP .Net Web Controls 0 09-20-2004 07:19 PM



Advertisments