473,699 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to create a property with drop options???

Hi,

I'm trying to create a property in a class that should be apepar as
dropdown combo at design time with X options. Something like the
WindowStateProp erty where you can select 3 options. How can this be done
I've tried several ways but can't get it to work. Whta am I doing wrong?.
This is what I have in the class

private ComboBox fieldType= new ComboBox();
private DataTable dtFieldType;
loadCombo();
[
DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content),
Editor(typeof(S ystem.Component Model.Design.Co llectionEditor) ,
typeof(System.D rawing.Design.U ITypeEditor)),
Description("Ty pe you want to display")
]
public ComboBox FieldType
{
get
{
return dtFieldType;
}
set
{
dtFieldType= value;
}
}

private LoadCombo()
{
this.dtFieldTyp e= new DataTable();
this.dtFieldTyp e.Columns.Add(" Type");
//=============== =============== ==============
DataRow drFieldType = dtFieldType.New Row();
drFieldType ["Type"] = "String";
dtFieldType.Row s.Add(drFieldTy pe);
//=============== =============== ==============
drFieldType = dtFieldType.New Row();
drFieldType ["Type"] = "Date";
this.dtFieldTyp e.Rows.Add(drFi eldType);
//=============== =============== ==============
drFieldType = dtFieldType.New Row();
drFieldType ["Type"] = "Numeric";
this.dtFieldTyp e.Rows.Add(drFi eldType);
//===
tipoCampo.DataS ource = this.dtFieldTyp e;
tipoCampo.Displ ayMember = "Type";
tipoCampo.Value Member = "Type";
}
The combo does show up in Design time but no options are present.

Help is really appreciated
Lucas

Nov 15 '05 #1
1 1105
I got it to work. I forgot about enumerators and they did the trick.
Oooppsss

Regards
Lucas

"Lucas Sain" <ls***@lidersof t.com> wrote in message
news:uU******** ******@TK2MSFTN GP12.phx.gbl...
Hi,

I'm trying to create a property in a class that should be apepar as
dropdown combo at design time with X options. Something like the
WindowStateProp erty where you can select 3 options. How can this be done
I've tried several ways but can't get it to work. Whta am I doing wrong?.
This is what I have in the class

private ComboBox fieldType= new ComboBox();
private DataTable dtFieldType;
loadCombo();
[
DesignerSeriali zationVisibilit y(DesignerSeria lizationVisibil ity.Content), Editor(typeof(S ystem.Component Model.Design.Co llectionEditor) ,
typeof(System.D rawing.Design.U ITypeEditor)),
Description("Ty pe you want to display")
]
public ComboBox FieldType
{
get
{
return dtFieldType;
}
set
{
dtFieldType= value;
}
}

private LoadCombo()
{
this.dtFieldTyp e= new DataTable();
this.dtFieldTyp e.Columns.Add(" Type");
//=============== =============== ==============
DataRow drFieldType = dtFieldType.New Row();
drFieldType ["Type"] = "String";
dtFieldType.Row s.Add(drFieldTy pe);
//=============== =============== ==============
drFieldType = dtFieldType.New Row();
drFieldType ["Type"] = "Date";
this.dtFieldTyp e.Rows.Add(drFi eldType);
//=============== =============== ==============
drFieldType = dtFieldType.New Row();
drFieldType ["Type"] = "Numeric";
this.dtFieldTyp e.Rows.Add(drFi eldType);
//===
tipoCampo.DataS ource = this.dtFieldTyp e;
tipoCampo.Displ ayMember = "Type";
tipoCampo.Value Member = "Type";
}
The combo does show up in Design time but no options are present.

Help is really appreciated
Lucas

Nov 15 '05 #2

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

Similar topics

1
6358
by: Greg Scharlemann | last post by:
I would like to automatically populate a drop down menu when the page loads based on the selection of an item in a different drop down menu. I made a test page that when drop down #1 changes, drop down #2 populates. Does anyone know how to get drop down #2 to populate based on what is selected in drop down #1 when the page loads? Here is my test code: ************************************************************************ <html>...
2
1634
by: Arpan | last post by:
An ASP application retrieves the DISTINCT records from all the columns of a SQL Server DB table & populates them in drop-down lists. The no. of drop-down lists on the web page depends upon the no. of columns in the DB table. For e.g. if the DB table has, say, 5 columns, the web page will show 5 drop-down lists. Assume that the DB table stores information pertaining to books like book name, category to which the book belongs to (like...
5
3271
by: Frank van Vugt | last post by:
Hi, I noticed that when using the single commandline: drop database <name>; create database <name>; this sometimes fails due to a pg_autovacuum process running on the background. When this happens, the error returned is:
7
8859
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I want my users to be able to select a report, click on a command button on a form, which will then automatically create the report as a pdf file and save it to the user's machine. I am using Adobe Acrobat (5.0 I think) and have Adobe Distiller as a
2
1094
by: ECVerify.com | last post by:
I am trying to make a property that creates a drop down control that I can fill with string options..."test1", "test2", "test2" I can make one with True false as shown here but I cant figure out how to make it do a dropdown with custom strings Private _numericTextBox As Boolean = False <Category("MyCategory"), Description("Sets the text box as
3
1040
by: zahidse | last post by:
Hi Can any body help me plz in creating a property with drop down options visible in Property Window I am using C# 2.0 I will be very thankful for +ve response Regards Zahid
1
5948
by: abTech | last post by:
Have struggled a lot to get a filtered drop down in the normal html and that too editable ... i have used table like auto-completion etc ... This is the simplest solution for a filtered drop down <SELECT NAME="drop" id='drop' onkeyup="editOption(arguments, this)" style='width:100px;cursor:text' mode="1"> <option value="0">Default</option> … </SELECT> Mode 0: Filters the list till a valid match is found, if not found then will behave...
4
8277
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my problems and this one is really getting to me... I have a page that allows you to Browse Authors. There are three drop down boxes that auto-populate via AJAX. I have a file which it calls and returns the dynamically built XML file in the boxes...
0
8686
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
9173
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
9033
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
8911
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
8882
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...
1
6533
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
4375
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3057
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
3
2009
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.