473,782 Members | 2,396 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 2878
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
2118
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
5213
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
9779
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
3128
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
7470
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
9480
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
10313
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...
0
10146
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8968
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...
0
6735
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
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
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
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.