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

Home Posts Topics Members FAQ

Need help on findcontrol() returns Nothing

2 New Member
Hi, I have two dropdownlist template columns in datagrid. Once the first one (Test Type, in column index 2, ID="ddlTestType ID") selection changed, I need to re-bound the second dropdownlist (test standard, column index 3, ID="ddlTestStan dardID"). So for the first dropdown control, I have: OnSelectedIndex Changed="OnDDLT ypeModified"

Private Sub OnDDLTypeModifi ed(ByVal sender As Object, ByVal e As System.EventArg s)

Dim ddl As DropDownList = sender
Dim myCache As New UtilityCacheMan ager() 'user defined class for datasource
Dim dgi As DataGridItem = ddl.NamingConta iner
'rebuild datasource for teststand
Dim ddlStand As DropDownList
ddlStand = dgi.Cells(3).Fi ndControl("ddlT estStandardID")
Dim dv As New DataView
dv = New DataView(myCach e.RFTData.RFTTe stStand) 'data source
dv.RowFilter = "TestType ='" & ddl.SelectedVal ue & "'"
ddlStand.DataSo urce = dv
ddlStand.DataBi nd()

End Sub

dgi.Cells(3).Fi ndControl("ddlT estStandardID") returns 'Nothing'

What I did wrong here? Please help me!
Thanks and regards!

Jin
Nov 7 '06 #1
0 1051

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4136
by: MattB | last post by:
This is just a rephrased version of a question I posted earlier. I think I'm closer now, so it seemed worthy of a new (more specific) post. In my repeater I'm dynamically creating text boxes, so at compile time I don't know what text boxes are going to be present at run time. This is where it seems the FindControl method would be come into play. I loop through a list of control (all textboxes) names I created on page load and see if they...
2
11175
by: MattB | last post by:
I've got some controls (mostly textboxes for now) that get created at runtime in a DataGrid. I create them using the OnItemDataBound event. I realize this isn't ideal, but I'm trying to see if I can make this work anyway. In a button click event I loop through the dataset the datagrid is bound to and try to use FindControl to get at my controls. Below is a snippet from the button click event: iRow = 0
10
1896
by: Terry Olsen | last post by:
I've got a datagrid set up to display data. I've also got an Edit,Update,Cancel column set up to allow editing of data. I've got a DropDownList (ID="ddl3")in the EditItemTemplate for a certain column that I need to populate while in Edit Mode. Two questions: Is there a way to directly use another DropDownList as a DataSource? If so how? I'm using the following code to try to populate the DropDownList, but
5
2749
by: Siva | last post by:
Hello I have a dropdownlist inside the gridview as a template column defined as follows: <asp:TemplateField HeaderText="Choose Location"> <ItemTemplate> <asp:DropDownList ID="ddlChooseLoc" runat="server"> </asp:DropDownList> </ItemTemplate> </asp:TemplateField> I have the gridview inside of a master page- content hierarchy.
2
1699
by: John Smith | last post by:
I have this code: <asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:TemplateColumn HeaderText="SM"> <ItemTemplate> <asp:Label id="Label2" runat="server" Text='<%# Container.DataItem("SM") %>'> </asp:Label> </ItemTemplate>
1
1326
by: divingIn | last post by:
Hi, I have a master page and a content page. From my content page i can access the master page controls using Master.FindControl() but i cannot access controls from my content page using FindControl(). For any control it just returns null. I have been trying for so long with no success. so frustrated! Please help. eg. FindControl("Table_Search") and FindControl("Content1") returns null. <CODE> <%@ Page Language="C#"...
15
1315
by: Keith G Hicks | last post by:
I'm not sure what I'm doing wrong. Here's my code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim hyp As HyperLink = CType(Me.FindControl("hypFilt" & Request.QueryString("Filt")), HyperLink) If Not hyp Is Nothing Then hyp.Font.Bold = True EndIf
7
5691
by: AAaron123 | last post by:
Me.FindControl("MissionScheduleID"), below returns null. Do you know what I'm doing wrong? Thanks ***In my .aspx file I have: asp:Content ID="Content3" contentplaceholderid="MainMasterLeftDataID" runat="server">
4
2977
by: Hillbilly | last post by:
Maybe this is or isn't some kind of bug but it sure is goofy and remains a mystery that really has me puzzled for two reasons... // goofy syntax functions as expected... Panel finalStepButton = Page.Master.FindControl("CenterPanelContent $ItemBuilderWizard $StepNavigationTemplateContainerID $StepNavFinalStepButton") as Panel;
0
8240
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8175
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8680
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8336
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7168
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6111
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5565
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.