473,657 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 ListViewSortMan ager SortMgr1;

and in the InitialiseCompo nent
this.SortMgr1 = new ListViewSortMan ager(......);

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

Thanks,
Lut

Nov 15 '05 #1
1 1738
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)paldin o=at=exisconsul ting<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 ListViewSortMan ager SortMgr1;

and in the InitialiseCompo nent
this.SortMgr1 = new ListViewSortMan ager(......);

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
12497
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 directly derived from the .net classes ComboBox and TextBox) I did the custom control in the visual studio .net designer in which i
5
1625
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 be in the main project as a file...in other words, it doesn't look like you can add a reference to a custom created control and leverage an .asxc within it. Is this correct?
21
2092
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 string with comma delimited values. For example, if I were to render two text boxes. One with the Value Terry and the Other with the Value 'Burns' I would get the following value Terry,Burns.
2
1518
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 Control for same (custom control is prefarable). Below is my code of ASPX page which is working fine.... Here i have used Response, to generate the bar but how do i use it in the webcontrols...
2
3428
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 the individual ActiveX's to the toolbox & when I try to host the user control on the form using the toolbox, the VS.NET interop kicks in generates Ax*** wrappers for these.
6
11068
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 how those properties are set. I want to be able to do two other things: a) add User control instances to my page, filling in the place of placeholder controls, and b) programmatically setting custom properties on those dynamically spawned...
15
6505
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 accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then i added this line "" before my custom control class (i dont know what this line does). Now
4
8935
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 CreateUserWizard control), i want to let asp.net generate a password and to send it (AutoGeneratePassword="true") to the address of the email provided by the new membershipuser in the CreateUserWizard control.
6
1875
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 pressing a button or changing text in a textbox). It gets set up and on the user control on my web page I can see the event from intellisense. So it seems to be set up, but I am trying to get an easy example of how I would now use this event. ...
0
8403
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
8316
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
8833
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8737
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...
0
8610
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5636
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.