473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

DataGrid Custom Child Control Problem

I have a Web DataGrid into which I've added a templatecolumn. Into the
templatecolumn I've placed a progressbar custom control (which
provides its rendering by overriding the Render method of the custom
control). When the templatecolumn is added, to the DataGrid, I've also
added a DataBinding event handler (addressof method) for the control
(which is used to set the progressbar properties).

When I run the web page (in debug) I get the DataBind event fired for
the progrssbar on each successive row (DataGridItem) and, set some
static property values (for testing). However, the progressbar render
method is only called for the last row of the DataGrid (none of the
previous progressbar controls even show up in the HTML).

I would really appreciate any help/insight into this problem.

tia
Glenn
Nov 18 '05 #1
1 963
OK, I found the "problem". It seems that I need to instantiate the
control object, that is to be placed into the templatecolumn
container, in the InstantiateIn method.

So, I'm passing a control, which I've created in the aspx code-behind
in response to an event in my DataGrid, into my TemplateColumnFactory
class. The factory class figures out that it doesn't "know" the class
type being passed in so it performs the following in the InstantiateIn
method:

If Not IsNothing(_ctl) Then
Dim wc As System.Web.UI.Control = _
DirectCast(ObjectLoader.LoadObject(_ctl.GetType),S ystem.Web.UI.Control)

ObjectLoader.DeepCopy(_ctl, DirectCast(wc, Object))

AddHandler wc.DataBinding, AddressOf OnDataBinding

container.Controls.Add(wc)
End If

This works great...

=====================================
=====================================

Now, has anyone had any success at loading a System.Web.UI.WebControls
- based object? When I try loading, ie a
System.Web.UI.WebControls.Label I get the following message:

File or assembly name System.Web, or one of its dependencies, was not
found.

I know that the assembly is referenced in the project so why can't it
be located?

Glenn
Nov 18 '05 #2

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

Similar topics

6
by: Ben | last post by:
Hi I've got a problem with a custon control that inherits form the UserControl class and that used the overlib javascript library. The control works well in a standard form but when I used it in...
3
by: Skowronek | last post by:
What is the best method to obtain a data value from a parent datagriditem from a child datagrid - datagrid footer item command event handler? Here is the layout of my asp.net controls ...
1
by: jwogick | last post by:
I'm hoping someone can help me! I just have a simple form with a datagrid displaying child records from a dataset that contains two related tables Parent table>Clients Child table>cases. using the...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.