473,403 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Getting inside a template column

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
1 832
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Partridge | last post by:
Is it possible to access your caller's (not parent) context while inside a <xsl:template match...> or <xsl:for-each...>? Here is the xml I'm using: <report-set> ...<report> .....<detail-data>...
0
by: Oleg G. | last post by:
Hi there! I have datagrid with template column and I am using the same user control for display (in ItemTemplate) and collect (in EditItemTemplate) information. The user control is a number of...
2
by: Amir Eshterayeh | last post by:
Dear Friends I put a asp.net hyperlink control inside a datagrid as even a template column or hyperlink column but can not force datagrid to open a new window when I clicked on the hyperlink. I...
0
by: mehul | last post by:
CheckBox template always evaluate to False even if checked in a DataGrid hosted inside a TabStrip in ASP.NET Hi, I am trying to develop an ASP.NET application. I am using TabStrip (which is...
0
by: vbMental | last post by:
I created a user control that, had a datalist with checkboxes inside of the item template. These checkboxes would not retain state. For instance, if I set them to checked inside of the load event...
1
by: Manny Chohan | last post by:
Hi, i have a template column in datagrid. Inside template column i have panel. I want to control the visibility of the panel with checkbox. can this be done? <asp:TemplateColumn> <ItemTemplate>...
0
by: shbrittan | last post by:
I need to have my users type in instructions in either plain text or with imbedded html tags at their choice. The typed data along with other columns are stored in a sql database, then displayed in...
1
by: NishChaks | last post by:
Hi, I have a texbox which is a template column of a grid and the grid is inside the repeater. If there is only one control in the repeater then we can use foreach (RepeaterItem item in...
0
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
In VS2008, I have a DetailsView control with a checkboxlist control inside its Edit template. (1) I want the checkboxlist to be dynamic and display only as many checkboxes as a user setting is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.