473,387 Members | 1,529 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,387 software developers and data experts.

System.Management.PropertyDataCollection -> PropertyGrid ?

Greetings.

I would like to display the WMI properties for a printer
in a PropertyGrid, with minimal coding.

A WMI printer object is represented in managed code
using the System.Management.ManagementObject class,
which has a property named "Properties". The Properties
property is a PropertyDataCollection of PropertyData
objects, one PropertyData object for each property of the
printer.

Each PropertyData object has a Name (string) property
and a Value (object) property.

Any suggestions on how to approach this are appreciated.

--
Tony M.
Nov 17 '05 #1
1 2463
Tony,

I think you are going to have to create another object that will do this
for you. Basically, that object will implement the ICustomTypeDescriptor
interface, which the property grid will call upon to get the properties that
it should display.

Also, check out the .NET Matters section of MSDN magazine for April and
May of 2005. You can find them at:

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

and

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

These deal specifically with creating a custom wrapper that you can use
in your property grid control to control which properties are displayed.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Tony Maresca" <to**@whereever.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Greetings.

I would like to display the WMI properties for a printer
in a PropertyGrid, with minimal coding.

A WMI printer object is represented in managed code
using the System.Management.ManagementObject class,
which has a property named "Properties". The Properties
property is a PropertyDataCollection of PropertyData
objects, one PropertyData object for each property of the
printer.

Each PropertyData object has a Name (string) property
and a Value (object) property.

Any suggestions on how to approach this are appreciated.

--
Tony M.

Nov 17 '05 #2

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

Similar topics

2
by: Paul Gronka | last post by:
I've got a VB.NET windows application (written in VS .NET 2003) that makes a call to WMI for retrieving the MAC Address from the client's PC. It works on 4 out of the 5 PC's tested so far. All...
1
by: PaulThomas | last post by:
I am using VS.Net 2000 and C# trying to access the System.Management namespace in a Web Application -but- after: using System; using System.Management; I get: The type or namespace name...
0
by: Masood Siddiqi [MSFT] | last post by:
Hi, I am getting this exception Unhandled Exception: System.Management.ManagementException: COM object that has been separated from its underlying RCW can not be used. --->...
2
by: J M | last post by:
Getting NullReferenceException walking through printer properties: ObjectQuery names = new ObjectQuery("SELECT * FROM Win32_Printer"); ManagementObjectSearcher printQueues = new...
1
by: lcifers | last post by:
I have an application that uses the following code to return the default printer: Dim moReturn As Management.ManagementObjectCollection Dim moSearch As Management.ManagementObjectSearcher Dim...
7
by: eric | last post by:
I'm writing a program in C# and found a couple of threads about how to check the status of a printer before sending it any data, to ensure that the printer is ready to print. They say to include...
3
by: Anil Gupte | last post by:
I am getting this error: Type 'System.Management.ManagementClass' is not defined. The statement is: Dim diskClass As New System.Management.ManagementClass("Win32_LogicalDisk") According to the...
8
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i trying to collect windows services. i'm getting inconsistencies. the collection works every time locally. but remote collection yields different result depending on my lab environment. 1) in...
3
by: Marco Shaw | last post by:
I've got some C# code to create a custom PowerShell cmdlet with these statements: .... using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; .... ...
2
by: karthi84 | last post by:
Hi Experts, i have created a web application which has an option to edit the web config file from the web page. when i create an installer for this project using web setup project in VS2008 and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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...
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...

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.