473,811 Members | 3,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PropertyGrid with ComboBox containing dynamic data

Hello,

I am using a propertygrid to allow users to edit\create objects at
runtime, that can update records in a database. There are certain
properties (fields) that I wish to display as comboboxs. Currently I
can create an enum, which the propertygrid displays as a combobox.
However since the comboxbox needs to be populated from a database
query, hardcoded enum's won't work. Is there a means with which to
create or define an enum at runtime? Or does anyone have sample code
on how to alter the behaviour of a propertygrid to display dynamiuc
data in a combobox?
newbie
Nov 15 '05 #1
1 10216
You can set a table or array as DataSorce to the combobox
If you have inside a DataSet a Table ("comboboxtable ") with two columns "id"
and "name",
you can do the following thing:

ComboBox.DataSo urce=DataSet.Ta ble["comboboxta ble"];
ComboBox.Displa yMember="name";
ComboBox.ValueM ember="id";
"newbie" <ms******@yahoo .com> schrieb im Newsbeitrag
news:51******** *************** ***@posting.goo gle.com...
Hello,

I am using a propertygrid to allow users to edit\create objects at
runtime, that can update records in a database. There are certain
properties (fields) that I wish to display as comboboxs. Currently I
can create an enum, which the propertygrid displays as a combobox.
However since the comboxbox needs to be populated from a database
query, hardcoded enum's won't work. Is there a means with which to
create or define an enum at runtime? Or does anyone have sample code
on how to alter the behaviour of a propertygrid to display dynamiuc
data in a combobox?
newbie

Nov 15 '05 #2

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

Similar topics

2
3983
by: Mevar81 | last post by:
Hi to everybody.I have a problem with the PropertyGrid control.I want to display not all the properties of a generic Control(Button,TextBox,ComboBox,ecc.).In general I don't want to display only one category(Appearance, Behavior,ecc.) but I want to chose directly which properties to show.I've read that I can use the SelectedObjects to put an array of object with some properties in common with the SelectedObject,and only properties in...
1
24683
by: Daniel | last post by:
How do I use a combobox in a propertygrid without using enum ? Any suggestions?
0
1781
by: Paul Talbot | last post by:
Hi, I'm after help using reflection with the propertygrid. I am creating a dynamic class and putting it into a propertygrid. For simple textboxes, static content dropdowns and datetime controls it is fairly simple. However I need a dynamic dropdown list. I have an object that contains a list of departments. I want to add this to a dropdown list within the propertygrid.
1
11892
by: ANDRES BECERRA | last post by:
Herfried K. Wagner was kind enough to point me to the PropertyGrid control http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformspropertygridclasstopic.asp I have found a few samples of how to use the PropertyGrid control and have gained a decent understanding of it. But of course, as it usually the case, my needs go far beyond the simple examples shown in online samples. All the online samples show how to take a class...
0
1553
by: Marco Segurini | last post by:
HI, my form contains a combobox and a propertygrid control. At each string of the combobox is associated an object. When I select a string of the combobox the associated object is selected in the propertygrid in this way: this.propertyGrid1.SelectedObject = aObject; this.propertyGrid1.Refresh();
7
3852
by: Ron M. Newman | last post by:
Hi, Can the native PropertyGrid accept dynamic properties? ones that are not pre-compiled into a class and don't have those thingies attached to properties? Can I just instantiate a property grid and put a dynamic "Name" property in there without having a class with a name property "fed" to it? Thanks Ron
4
18831
by: phcmi | last post by:
I have a PropertyGrid question. My task is to replace a legacy dialog box presentation with a modern one. The dialog itself allows the user to set configuration settings in our application, so it seems to me that a PropertyGrid is a perfect modern replacement. I won't bore you with the details with all the controls on the dialog since I'm only concerned with one issue. The legacy dialog contains a drop down list control that is...
3
5194
by: Redivivus | last post by:
Hi Ho to use dropdown in propertygrid with values from database? Lets say i have table ITEMS and columns ID, NAME Now i want to select id, name from items and display those values in dropdown of my propertygrid
2
7951
by: Marco Segurini | last post by:
Hi All, I have a form containing only a PropertyGrid that I use to modify an instance of the following class: class MyClass { Point _point = new Point();
0
9603
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
10379
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
10393
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
10124
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
9200
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
7664
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
6882
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
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3015
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.