473,471 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Complex Custom Control Conundrum

Can I apologise for the lengthy nature of this post. The scenario is
complicated (though I hope the solution is not!)

basically, I've got a custom template control which binds itself to a tree
structure. The template items describe how each particular note type of
the tree should be rendered (the nodes are data capture elements - bool
string and more complicated things).

I don't want to use ViewState because of size (there are potentially
hundreds of elements on the page).

So what I do is to perist a key to the root node in the viewstate and the
recreate and bind the control heirarchy in the LoadViewstate and see what
changes have been made from the postback data. I do this in the OnLoad
method by reading recursively scanning the control tree looking for certain
control names and updating the corresponding tree node data element if
needed.

Finally, if I need to I will tear down the control tree and recreate a new
one.

This was all more or less working until I added a new custom control type.

This custom control wraps a DropDownList which is to be populated from the
node of my data structure. I need to record the selected item which I do
with a custom property and handling LoadPostData to get the correct value
for this from the PostCollection (which should later be picked up by OnLoad
routine).

And to the problem. Well, depending on some niceties, I seem to have a
choice of not creating the control tree (that is CreateChildControls is not
called) for this particular custom control and having LoadPostData called
(with no control name so no way to find hte correct post data) or having
the control created but not having the LoadPostData method called. The
template handler for the element is called, but the DropDownList does not
appear to be created at that point because the reference to the tree node
which it needs has not been bound.

Now, having said all that, since I started moving code around, it looks
like none of the changes are been found, which may be that no LoadPostData
calls are being made in the postback (more or less, I've moved the control
creation from OnLoad back into LoadViewState).

If any of this rings a bell, I'd be grateful for any pointers!
Iian
--
Iain Downs (DirectShow MVP)
Commercial Software Therapist
www.idcl.co.uk
Feb 17 '06 #1
0 1312

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

Similar topics

8
by: Steve Jorgensen | last post by:
Mailing List management is a good example of a case where my conundrum arises. Say there is a m-m relationship between parties and groups - anyone can be a member of any combintation of groups. ...
0
by: andrew lowe | last post by:
Hi We have windows application and have created our own custom principle & identity objects that implement IPrinciple and IIdentity. When a user logs into our system we set the threads principle...
3
by: Dennis M | last post by:
Hey everyone, I am curious what the performance impact of a custom control would be if it had a significant hierarchy of children. For example, 40 child controls, 5 levels deep, each control on...
1
by: Dot net work | last post by:
Hello. I have an interesting data binding scenario: I have a repeater control. It repeats a typical custom web user control. I also have a collection object, and each collection element...
5
by: Trail Monster | last post by:
Ok, I've been searching the net now for several days and can't find how to do this anywhere. Version: VS 2005 Professional Release, 2.0 Framework Background: I have a complex business object...
3
by: Bernie Yaeger | last post by:
I'm trying to create a custom control that has 2 listviews, in view smallicon. I'm using these with code that makes them drag/drop controls, so what I am after is a control that does drag/drop...
1
by: Jeremy Chapman | last post by:
I have a property will an array of webcontrols. The control features a custom property editor which can add and remove web controls to the array, but how do I persist the informtion by...
0
by: todd.freed | last post by:
Hello. I'll make this quick - its quite a conundrum I have the following markup <MyNS:MyControl runat="server" id="myId" CustomProperty1="value" CustomProperty1="value"...
6
by: junk | last post by:
Senerio: I have a custom user control which contains two control arrays. The user control has a group box in which the two control arrays are dynamically built. The two control arrays are...
0
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,...
0
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...
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,...
1
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: 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...
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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.