473,659 Members | 2,886 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

web custom control designtime problem

Hello,

I would like to make my own dropdownlist and add a collection as a generic
List.
When I enter items @ designtime, @ runtime they are gone.

Can anyone tell me please what the problem is?

This is my code:

[ToolboxBitmap(t ypeof(DropDownL ist))]

[ToolboxData("<{ 0}:MaxDropDownL ist runat=server></{0}:MaxDropDown List>")]

public class MaxDropDownList : System.Web.UI.W ebControls.Drop DownList,
IMaxControl

{

private List<GroupRight s_GroupRights = new List<GroupRight s>();

[Category("Right s")]

[Editor("System. Web.UI.Design.W ebControls.List ItemsCollection Editor,System.D esign,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a",
typeof(UITypeEd itor))]

public List<GroupRight sRights

{

get

{

return _GroupRights;

}

set

{

_GroupRights = value;

ViewState["Rights"] = Rights;

}

}

}

Thanx in advance,

Rotsj
Jan 10 '07 #1
2 1695
you never read the values back from the viewstate.

-- bruce (sqlwork.com)

rotsj wrote:
Hello,

I would like to make my own dropdownlist and add a collection as a generic
List.
When I enter items @ designtime, @ runtime they are gone.

Can anyone tell me please what the problem is?

This is my code:

[ToolboxBitmap(t ypeof(DropDownL ist))]

[ToolboxData("<{ 0}:MaxDropDownL ist runat=server></{0}:MaxDropDown List>")]

public class MaxDropDownList : System.Web.UI.W ebControls.Drop DownList,
IMaxControl

{

private List<GroupRight s_GroupRights = new List<GroupRight s>();

[Category("Right s")]

[Editor("System. Web.UI.Design.W ebControls.List ItemsCollection Editor,System.D esign,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a",
typeof(UITypeEd itor))]

public List<GroupRight sRights

{

get

{

return _GroupRights;

}

set

{

_GroupRights = value;

ViewState["Rights"] = Rights;

}

}

}

Thanx in advance,

Rotsj

Jan 10 '07 #2
thank you for your reply.

when I change the "rights" property like below it still doesn't work:
(In the Get method i first read the viewstate)

public List<GroupRight sRights

{

get

{

_GroupRights = (List<GroupRigh ts>)ViewState["Rights"];

return _GroupRights;

}

set

{

_GroupRights = value;

ViewState["Rights"] = Rights;

}

}

The control does not remember anything. Even in designtime it will not
remember his items.

Thanx in advance,
Rotsj

"bruce barker" <no****@nospam. comschreef in bericht
news:O2******** ******@TK2MSFTN GP06.phx.gbl...
you never read the values back from the viewstate.

-- bruce (sqlwork.com)

rotsj wrote:
>Hello,

I would like to make my own dropdownlist and add a collection as a
generic List.
When I enter items @ designtime, @ runtime they are gone.

Can anyone tell me please what the problem is?

This is my code:

[ToolboxBitmap(t ypeof(DropDownL ist))]

[ToolboxData("<{ 0}:MaxDropDownL ist runat=server></{0}:MaxDropDown List>")]

public class MaxDropDownList : System.Web.UI.W ebControls.Drop DownList,
IMaxControl

{

private List<GroupRight s_GroupRights = new List<GroupRight s>();

[Category("Right s")]

[Editor("System. Web.UI.Design.W ebControls.List ItemsCollection Editor,System.D esign,
Version=2.0.0. 0, Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a",
typeof(UITypeE ditor))]

public List<GroupRight sRights

{

get

{

return _GroupRights;

}

set

{

_GroupRights = value;

ViewState["Rights"] = Rights;

}

}

}

Thanx in advance,

Rotsj
Jan 11 '07 #3

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

Similar topics

10
5481
by: Matt Fielder | last post by:
I have developed a custom control to be used in my application. My application includes a form designer, so the control can be hosted while designmode for the control is either true or false, depending on whether they are using the form designer, or in "run mode". The custom control includes a slider control that is supposed to be active in our form designer (designmode=true) and inactive in our run mode (designmode=false). The problem...
0
1087
by: bell | last post by:
I was playing around with making a custom control very similar to the standard ComboBox: a TextBox combined with a ListBox. After trying it out, I ran into the following problem: When drawing my custom control at DesignTime, I need to size it so that I give enough room for both the text and list boxes. But the standard ComboBox has the List portion pop up outside of the "size" of the control, overtop of existing controls. How can I...
2
1238
by: Allan Bredahl | last post by:
Hi all Im currently constructing a Windows control that inherits from RichTextBox, but I'm having a bit of trouble with updating the control at design time. The senario is SIMPLIFIED as follows: My RichTextBox control : Public Class Crtb
0
1083
by: Allan Bredahl | last post by:
Hi all Im currently constructing a Windows control that inherits from RichTextBox, but I'm having a bit of trouble with updating the control at design time. The senario is SIMPLIFIED as follows: My RichTextBox control : Public Class Crtb
2
2433
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just fine. However, when attempting to assing default values as designtime in the propertygrid, nothing is working on the class object. I know that I am doing it wrong, any ideas what it is? Thanks in advance
1
8230
by: Kenneth Siewers Møller | last post by:
Hi there I have a custom label control (GradientLabel) which enherits from Label and basically just paints the background of a label in a gradient. In my code I have the following for the overidden OnResize event: protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics;
4
5822
by: ThunderMusic | last post by:
Hi, I have a custom form that works fine when I debug it or run it in release mode but cannot be loaded in the designer... Actually, it can be loaded in the designer when no control is on it, but the resizing tool (in the designer) is offset both horizontally and vertically and when I put a control on it, as soon as I save, the designer throws an exception (but cannot be reproduced everytime) and the form cannot be loaded anymore unless...
11
18112
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with ListView columns so it should be doable, thanks
2
1938
by: Ron | last post by:
I have this weird problem...I have a custom composited control written in C# comprising of a label and a textbox (in an assembly) If I import the control into a C# Win Forms project and place several of the controls on a page everything is fine...all of the positioning properties are correctly serialized to the designer code and the controls remain in their designtime positions. HOWEVER if I import the custom control into VB ..Net win...
0
8427
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
8332
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
8746
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...
1
8525
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
7356
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...
1
6179
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
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2750
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
1975
muto222
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.