473,464 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Custom Server Control and DataGrid Issue.

Hi Everyone.

It has been a long time since my last post. Nevertheless, I have built a
custom server control that allows a user to edit text, bolding, italics
strike though table insertion and manipulation etc etc. The control works
perfectly when placed outside a templated control but when placed in, for
instance, a datagrid EditItemTemplate, I get the following error on the
DataBind Method: the dreaded "Object not set to a referance" or something to
that effect. I suspected the problem was that the custom server control was
not available until a user selects to edit the specific DataGrid index so I
filled a dataview and set the custom server control to implement the
dataview but that didn't work.

Anywho, anyone have any suggestions to correct this problem?

PS. The datagrid binds alright when the custom control isn't placed in the
datagrid.

I am Sam-
Nov 19 '05 #1
1 1489
My best guess on the description is that you are trying to access a
property in this custom control in a template that does not contain the
control.

For example, you put the control in the EditItemTemplate, but in the
databind event, there is code like:

dim c as theCustomControl
c=e.item.findcontrol("CC")
c.visible=true

Without being like:

if e.item.itemtype=EditItem then
... The same code
end if

So when the DataBinding handler is processing a Item or AlternatingItem
(or Header or Footer) row, it is trying to get a reference to the control
that is not in that template.

Hope that's an accurate guess.

"Sam Samnah" <we**********@terraquest123.ca> wrote in
news:OS**************@TK2MSFTNGP15.phx.gbl:
Hi Everyone.

It has been a long time since my last post. Nevertheless, I have
built a custom server control that allows a user to edit text,
bolding, italics strike though table insertion and manipulation etc
etc. The control works perfectly when placed outside a templated
control but when placed in, for instance, a datagrid EditItemTemplate,
I get the following error on the DataBind Method: the dreaded "Object
not set to a referance" or something to that effect. I suspected the
problem was that the custom server control was not available until a
user selects to edit the specific DataGrid index so I filled a
dataview and set the custom server control to implement the dataview
but that didn't work.

Anywho, anyone have any suggestions to correct this problem?

PS. The datagrid binds alright when the custom control isn't placed in
the datagrid.

I am Sam-


Nov 19 '05 #2

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

Similar topics

0
by: Julien | last post by:
Hi, I created a custom server control, compiled as a DLL (it's a composite server control). In my apsx page, I use something like : <MyAssembly:MyObject properties> <asp:datagrid />...
0
by: paul.phillips | last post by:
Hi, I am a problem: I have a custom control called DataView that holds a DataGrid object. The DataGrid has an event attached (PageIndexChanged) now the problem is that the event is not being...
0
by: Lenny | last post by:
Hello, I have an html table template which I want to turn into ASP.NET custom control. I want to utilize the best features of OOP. I want to be able to create columns headings dynamically, add...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
1
by: philipl | last post by:
hi, i have a datagrid which display custom controls when user clicks edit, changing data. I am using customvalidator to validate this control. I can get validation of user input to work no...
7
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
4
by: | last post by:
I'm building some user controls. I very much like how you can build custom properties to be bound to a user control, and how instances of that control will show those custom properties in the...
1
by: Suresh | last post by:
Using ASP.NET 1.1 ---------------------- I have a custom collection of object that I'm binding to a datagrid. Each of these objects have another collection inside them. I have a user control...
1
by: rn5a | last post by:
I have created a custom server control which is actually a Button clicking which prompts a user with a JavaScript confirm message asking him whether he would like to proceed or not. If he clicks...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
1
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
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,...
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.