473,405 Members | 2,354 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,405 software developers and data experts.

Custom user control - generate code

Lut
Hey,

I made a custom usercontrol (Custom listview) in the
Control Library.

Now I want in the properties of design a property 'Sort'.
(That is not a problem to do that) But, when it is Yes
then I want to add following code in my class.

private ListViewSortManager SortMgr1;

and in the InitialiseComponent
this.SortMgr1 = new ListViewSortManager(......);

How can I generate this code when I choose in the design
time sort = yes

Thanks,
Lut

Nov 15 '05 #1
1 1729
Lut,

I think that what you will have to do is create a custom designer for
the Sort property. When the sort property is set to true, you would then
also set the SortMgr1 property to an instance of the class that you create.
However, I don't think you will be able to use the constructor like that.
If anything, you will have to create a new instance of the class (default
instance), and then set the properties on the instance (kind of like a
collection editor works).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- nick(dot)paldino=at=exisconsulting<dot>com

"Lut" <ne*************@pandora.be> wrote in message
news:24*****************************@phx.gbl...
Hey,

I made a custom usercontrol (Custom listview) in the
Control Library.

Now I want in the properties of design a property 'Sort'.
(That is not a problem to do that) But, when it is Yes
then I want to add following code in my class.

private ListViewSortManager SortMgr1;

and in the InitialiseComponent
this.SortMgr1 = new ListViewSortManager(......);

How can I generate this code when I choose in the design
time sort = yes

Thanks,
Lut

Nov 15 '05 #2

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

Similar topics

7
by: Martin Schulze | last post by:
Hello, i tried to compose myself a custom usercontrol which is derieved from System.Windows.Forms.UserControl. It contains 2 comboboxes and one textbox (which are also custom controls, but...
5
by: Dag | last post by:
Hi all, I have a project where we use lots of user controls. We would like to move them to private assemblied custom controls but from what I see this can't be done because the .ascx file must...
21
by: One Handed Man \( OHM - Terry Burns \) | last post by:
When using a custom control. In order to check and see if values have changed one has to implement the IPostBackDataCollection interface. The values returned for the control seem to be simply a...
2
by: rushikesh.joshi | last post by:
Hi All, I want to create a webcontrol which will generate a bar (bar chart). I have done some graphics code in my ASPX page and it's working fine, but how do i create a Custom Control or User...
2
by: Lionel | last post by:
Hi, I've created a C# custom control that references some ActiveX controls. I need to host this control on a form that also hosts the same ActiveX controls. So I add the custom control and...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
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...
4
by: Ben | last post by:
Hi, i have already posted a more or less similar thread but it's gone unsolved with the flow of the other threads .. When an anonymous user has created an new account (with the...
6
by: tshad | last post by:
I was looking at a page that showed how to set up a custom event and it seems to work ok. But I am not sure how I would use it. How would I subscribe to it. There is actual action (such as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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...
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
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...

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.