473,513 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Lost Controls

hey all,
in vb code behind the code goes like this in the RowDataBound event of a
gridView:
e.Rows.Cells(0).FindControl("myTextBoxID")

however, I can't seem to find the control in my C# code-behind? Is there an
extra cast or something I'm missing?

thanks,
rodchar
Nov 21 '06 #1
2 935
Its seems to me that you're missing the row number.
Have you tried e.Rows(n).Cells(0).FindControl("myTextBoxID") (where n is the
row number you want to search)?

--
HTH
____________________
Konstantinos Pantos
MCP Software Engineer
http://kostas.pantos.name

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:88**********************************@microsof t.com...
hey all,
in vb code behind the code goes like this in the RowDataBound event of a
gridView:
e.Rows.Cells(0).FindControl("myTextBoxID")

however, I can't seem to find the control in my C# code-behind? Is there
an
extra cast or something I'm missing?

thanks,
rodchar
Nov 21 '06 #2
Here's how I found it and also I might have been on the wrong RowType to find
it, I'm not sure yet.
(DropDownList)e.Row.Cells[2].FindControl("myTextBox")

"Konstantinos Pantos" wrote:
Its seems to me that you're missing the row number.
Have you tried e.Rows(n).Cells(0).FindControl("myTextBoxID") (where n is the
row number you want to search)?

--
HTH
____________________
Konstantinos Pantos
MCP Software Engineer
http://kostas.pantos.name

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:88**********************************@microsof t.com...
hey all,
in vb code behind the code goes like this in the RowDataBound event of a
gridView:
e.Rows.Cells(0).FindControl("myTextBoxID")

however, I can't seem to find the control in my C# code-behind? Is there
an
extra cast or something I'm missing?

thanks,
rodchar
Nov 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
7886
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
0
254
by: news.microsoft.com | last post by:
I have a collection of pages and user controls in a separate project that I compile and use in a sub folder of a all my projects. This is a collection of re-usable modules that I use on every...
3
1225
by: AC | last post by:
This happened to me once before and luckily I have been backing up regularly - but as i'm designing and testing, I went back to a page (heavily designed with many particular spacings, control...
3
3421
by: Ed Chiu | last post by:
Hi, I plan to use panel to store multiple HTML text in a web form page, here is the code snippet that add HTML into panel: Dim lit1 As New Literal lit1.Text = strHTML...
0
1130
by: Jan Klat via .NET 247 | last post by:
I have large webform with many dynamic controls. Here is theissue: At some state I am programaticlly adding rows to table. Firstcell of row contains ImageButton. I am attaching command eventto...
10
2676
by: Jeff | last post by:
Is there a workaround for datagrid contents being lost on postback? All other controls persist. It's just datagrids that appear to be reinitialized. It doesn't make sense to continually rebuild...
2
3020
by: Limin | last post by:
I add some picturebox in the listbox as controls like following. Dim myPic as PictureBox 'Init myPic from here '... '... for i=0 to 30 'New picturebox '... 'set mypic property '....
14
1725
by: Ron L | last post by:
All I am working with a DataGrid and a form consisting of a number of text, checkbox, combobox controls, all bound to the same datatable. When I click on my "New" button, I create a new row,...
3
1671
by: hula | last post by:
Hello againe a "basic" question on UserControls. I have some UserControls inside a panel. Inside the controls i have checkboxes, comboboxes and textboxes. On change of any data inside the...
1
4346
by: BrenB | last post by:
I'm trying to trap for an event in my user control so that I can manage the state of the user interface. The control is used to enter data into a database. The control contains a tab control...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7161
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
7384
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
7539
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
7525
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...
1
5089
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...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.