By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 860 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

Getting inside a template column

P: n/a
I'm writing a Grid Print component and I am being passed a datagrid. I have
to take apart the various columns in order to print them.

In the case where the grid had a template column that is a text box, I am
finding that myItem.Cells(i).Controls(0).GetType.Name gets "LiteralControl".

I can't seem to find out how to tell what kind of control it is i.e.
dropdownlist, textbox etc. I suppose I could try casting it as a textbox to
see if it throws an exception but I don't want to do that as it would slow
things down.

Anyone know how to see what kind of control it is?
Thanks,
G
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Try going one level further:

myItem.Cells(i).Controls(0).Controls(0).GetType.Na me

Eliyahu

"G Dean Blake" <gb@nospam.com> wrote in message
news:Oy**************@tk2msftngp13.phx.gbl...
I'm writing a Grid Print component and I am being passed a datagrid. I have to take apart the various columns in order to print them.

In the case where the grid had a template column that is a text box, I am
finding that myItem.Cells(i).Controls(0).GetType.Name gets "LiteralControl".
I can't seem to find out how to tell what kind of control it is i.e.
dropdownlist, textbox etc. I suppose I could try casting it as a textbox to see if it throws an exception but I don't want to do that as it would slow
things down.

Anyone know how to see what kind of control it is?
Thanks,
G

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.