473,769 Members | 6,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

e.Item.FindCont rol("DropdownId ") Returning Null

Hi Group,

I have a datagrid with dropdown in my application.
I want to fill the data in dropdown by an ArrayList
for that I am using "e.Item.FindCon trol("DropdownI d")"
but this function is returning NULL THUS I m getting exception
"Object Refrence not set to an Instance to Object",

Here is the code I wrote (ASP.NET 1.1)...

Hope I get some help from you,

///Cdoe Behind
private void dataGrid1_ItemD ataBound(object sender,
DataGridItemEve ntArgs e)
{

if(e.Item.ItemT ype == ListItemType.Fo oter)
{

System.Web.UI.W ebControls.Drop DownList drp = new
DropDownList();
drp = (DropDownList)e .Item.FindContr ol("listAnup") ;
drp.DataSource= newArrayList;//This Statement throwing exception
drp.DataBind();
}

}


///aspx code

<asp:datagrid id=dataGrid1 style="Z-INDEX: 101; LEFT: 256px; POSITION:
absolute; TOP: 8px" runat="server" ShowFooter="Tru e" CaptionAlign="T op"
Caption="Hello" BackColor="Rosy Brown" AllowPaging="Tr ue" Height="256px"
Width="70%" DataSource="<%# dataSet1 %>" PageSize="2" CellPadding="2"
CellSpacing="2" >
<FooterStyle ForeColor="#FFF F80" BorderColor="#E 0E0E0"
BackColor="Gray "></FooterStyle>
<SelectedItemSt yle ForeColor="#804 040" BorderColor="#F FE0C0"
BackColor="Aqua "></SelectedItemSty le>
<EditItemStyl e ForeColor="#FFE 0C0"
BackColor="#C0F FC0"></EditItemStyle>
<AlternatingIte mStyle ForeColor="Dark OliveGreen"
BackColor="#FFC 080"></AlternatingItem Style>
<ItemStyle ForeColor="#404 040" BackColor="Khak i"></ItemStyle>

Mar 25 '06 #1
1 2874
MFB
I don't see that you have a control named *listAnup* in the footer which
is where you're looking for it. For that matter you don't have one
called that at all in your code. Is this all of the code?

Mar 25 '06 #2

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

Similar topics

0
1554
by: Sara | last post by:
We have a Cobol stored procedures on DB2 OS/390. We are able to access the stored procedures from a distributed platform Windows 2000/ Linux / Unix using DB2 Connect. But it does not return column names. It returns only column numbers. When we try to retrieve the metadata of resultset , it is returning NULL for column names or any other meta data from ResultSetMetaData Object. Can you please advise how to resolve this problem. Thanks...
0
2117
by: Atul | last post by:
I have a .Net Managed C++ wrapper control for a MFC control. When using the ..Net control in a Visual Studio 2005 Beta 2 C# project and running in Debug mode, I get a crash saying something like "First Chance Exception : memory cannot be read". I found that this was becuase a call to AfxGetThread() was returning NULL. I tried using AFX_MANAGE_STATE(AfxGetStaticModuleState()); but it did not solve the problem. Furthermore, this crash only...
0
2204
by: George Durzi | last post by:
cross posted in datagrid group. Inside <columns/> in my datagrid, I have the following template column <asp:templatecolumn HeaderText="To Be Completed By"> <itemtemplate> <asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.FULL_NAME") %>'><asp:label> </itemtemplate> <edititemtemplate>
2
3950
by: Kel Good | last post by:
Hello, I am binding a custom IList object to a DataList that I am using for a web menu. The items in the custom IList have properties that allow me to dynamically define how my menu behaves. My binding syntax is standard: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load MenuItems.DataSource = GetMyCustomIList MenuItems.DataBind()
9
5212
by: Thomas Mlynarczyk | last post by:
Hi, It seems to be a generally adopted convention to have a function return FALSE in case of an error. But if a function is supposed to return a boolean anyway, one cannot distinguish anymore between the "normal" FALSE and the "error" FALSE. So why not using NULL instead to indicate an error? Are there drawbacks I am not aware of? Greetings, Thomas
5
9777
by: anupamjain | last post by:
Tired, Exhausted, searched the web, usenets,forums thorughly but still clueless. I guess it's time to post on the group : This is the issue I have been trying to resolve since today morning : I have an XHTML document in string form which I parse using Xerces DOMParser (using an InputSource to read it). Now I am trying to get to a node for which I have the Xpath, using the XPathAPI.
3
3127
by: rrpbatni | last post by:
Hi, I have a doubt in C++ where my method setlocale which is passed with two parameters LC_ALL and data_file_locale string for Portuguese locale is failing and returning NULL… What might be the probable reasons… Can you please let me know…???
1
7469
by: sbowman | last post by:
I have the following CASE statement in a view: (SELECT CASE WHEN ISNULL(.., NULL) = NULL THEN .(..) ELSE .(..) + ', ' + .. END) AS ContactNameAndTitle It works perfectly when dbo.tblContact.JobTitleID is NOT null. When it
2
2538
by: aaronharwood | last post by:
I have read dozens of existing responses on threads, that span the last 5 years or so, concerning this problem and while there are many solutions that appear to work for others - none work for me. I have some Javascript that is receiving an XML file from a Servlet. The problem is that the XMLResponse always returns a null value. Here is some the code snippet: ... function alertContents() { if (http_request.readyState == 4) { ...
0
9589
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
9423
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
10211
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
9994
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
9863
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7409
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
6673
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();...
1
3959
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.