Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Finding Grid controls

Reply
Thread Tools

Finding Grid controls

 
 
Rick Spiewak
Guest
Posts: n/a
 
      07-24-2003
I have been unable to find an elegant way to navigate to the controls in a
DataGrid in edit mode in order to get the changed values. I end up with a
lot of code like:

e.Item.Controls(5).Controls(0)

to get at a simple textbox, or:

e.Item.Controls(5).Controls(1)

if there is a multiline text box.

No ID's seem to end up on these controls, and I can't seem to find a
generalizable, clean way to access them. Any ideas?

Regards - Rick


 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      07-24-2003
I don't know if this is OK for you but I sometimes use template columns,
then I name the controls in design mode, and access them this way :

Dim txt as Textbox
txt=ctype(e.Item.fincontrols("txtName"), Textbox)

"Rick Spiewak" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have been unable to find an elegant way to navigate to the controls in a
> DataGrid in edit mode in order to get the changed values. I end up with a
> lot of code like:
>
> e.Item.Controls(5).Controls(0)
>
> to get at a simple textbox, or:
>
> e.Item.Controls(5).Controls(1)
>
> if there is a multiline text box.
>
> No ID's seem to end up on these controls, and I can't seem to find a
> generalizable, clean way to access them. Any ideas?
>
> Regards - Rick
>
>



 
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
I need a container to hold grid positions and the objects on the grid? Simon L C++ 3 03-31-2006 03:38 PM
Grouped grid? Or grid within datalist? Danny Tuppeny ASP .Net 1 10-27-2005 10:03 PM
How to transfer a value from an Invisible Grid to an visible Grid =?Utf-8?B?QXNzYW5LaGFuIElzbWFpbA==?= ASP .Net 2 10-17-2005 03:56 AM
Grid within a Grid ItemDataBound event problem Girish ASP .Net 4 07-19-2005 01:17 AM
Grid question: How do I force grid elements to expand and use available space Marc Python 0 10-08-2003 05:06 PM



Advertisments