|
Hi,
Say i have a class User with some public properties
-FirstName
-LastName
-Email
I then load an ArrayList (arrUsers) with User objects and set a DataGrid's datasource = arrUsers.
The grid will create three columns (FirstName,LastName,Email) and fill them with data.
What i really wonder is if there's a way to control which properties in the User object the datagid will use.
Maybe an attribute or implementing an interface. Setting the properties to private isnt good enough nor is creating the datagrid's columns with a datafield.
Niclas Ahlqvist
|
|
|
|
|
Is there a place on the web that cna show some samples or give ideas of different types of user interfaces?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
DesigningInterfaces.com[^]. While the page itself is somewhat of an advertisement for the book, the site contains many free UI examples and patterns applicable to both desktop and web apps (see the links on the left of the page).
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Lent Revisited
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I tried two ways of obtaining drive letters, one using Directory.GetDriveNames() and the other using ManagementObjectCollection . In both cases, my app checked the A drive and sometimes also D drive. This caused that terrible noise from diskette drive or/and a "no media in drive" dialog appeared every time the application is launched.
I can just skip the problematic "A" and "D" drives, but this is a dirty solution, because not all users have A,C,D drive letters.
|
|
|
|
|
I would have to disagree....a little on that.
Most computers come with a floppy, a harddrive, and a CD-ROM. If so they will always be A, C, D respectively. While you can purchase some computers without a floppy or a CD-ROM, almost 90% of the time you will not. Why? How else will you install the OS is need be without removing the harddrive?
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Floppies are becoming sparse on newer machines, many oems are including an X-in-1 card reader instead. A bootable CD will install the OS without need for a floppy. Enough are also putting recovery data on a 2nd partition instead of, or in addition to a floppy that even on oem boxes assuming D for the CD is chancy. Self build machines often have multiple HDs as well, my personal machine has cd drives at H and I due to partition based data segragation and multiple harddrives.
|
|
|
|
|
I agree that floppies are going out the window. With the flash drive being the choice portable data transport.
However CD-ROMs will be around for quite a while and since I never said that all machine have them, there are the select few who do not order them with their machines. Heck I even had a PC that had no floppy, harddrive, or CD-ROM. It had a boot ROM on the network card and booted from a boot file on the network. That was back awhile. No sure if they still do that.
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote: However CD-ROMs will be around for quite a while and since I never said that all machine have them, there are the select few who do not order them with their machines. Heck I even had a PC that had no floppy, harddrive, or CD-ROM. It had a boot ROM on the network card and booted from a boot file on the network. That was back awhile. No sure if they still do that.
True. My point was that you can't just assume the CD drive is D:.
|
|
|
|
|
if nothing else try this:
<br />
try <br />
{<br />
string[] drives = System.IO.Directory.GetLogicalDrives();<br />
<br />
foreach (string str in drives) <br />
{<br />
System.Console.WriteLine(str);<br />
}<br />
}<br />
catch (System.IO.IOException) <br />
{<br />
System.Console.WriteLine("An I/O error occurs.");<br />
}<br />
catch (System.Security.SecurityException) <br />
{<br />
System.Console.WriteLine("The caller does not have the " +<br />
"required permission.");<br />
}<br />
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Check the type of the drive. If it's a removable drive you should skip it.
---
b { font-weight: normal; }
|
|
|
|
|
Yes, but I can't check the type of drive without obtaining the collection of drives:
ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * From Win32_LogicalDisk ");
ManagementObjectCollection queryCollection = query.Get();
after query.Get() on the second line, the A drive is checked even when there is no diskette.
|
|
|
|
|
You can always use this:
static public void Main(string[] args)<br />
{<br />
<br />
for (char driveLetter = 'A'; driveLetter <= 'Z'; driveLetter++)<br />
{<br />
DriveInfo drive = new DriveInfo(driveLetter.ToString());<br />
switch (drive.DriveType)<br />
{<br />
case DriveType.NoRootDirectory:<br />
break;<br />
default:<br />
Console.WriteLine("Found drive at " + drive + " of type " + drive.DriveType);<br />
break;<br />
}<br />
}<br />
}<br />
It will only make the annoying noise when you access the properties of the drive instance.
bool ready = drive.IsReady;
Like that.
|
|
|
|
|
This works on .NET 2.0, but I have to solve the problem on .NET 1.1
|
|
|
|
|
I wan to know the code for physical address(d:\songs) to a vitual address(\\172.13.23.987\songs) convertion in C#.
hiii
|
|
|
|
|
Is this virual address the IP address of the machine? How the virtual address is determined affects the answer to your question.
|
|
|
|
|
yes if i am in a system called \\hls-pc002 and store a wave file in d drive (which is shared)
hiii
|
|
|
|
|
Get the IP address of the local machine:
using System.Net;
...
IPAddress address = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0];
|
|
|
|
|
I came across the following window message codes sent to WndProc of the main form of a C# application. These messages are generated when the form starts up. There are no published WM_ constants for these. Does anyone have an idea what they represent?
UNKNOWN: 297 (H129)
UNKNOWN: 295 (H127)
|
|
|
|
|
You'd be more likely to get an answer to this in the c++ forum since hte msg codes are are win32api.
|
|
|
|
|
|
Those codes are Win32 macros for the Windows message pump. C++ applications have to handle them, C# (or .NET) ones don't. They are handle under the hood. If you want to have access to them, you override it in your Form-derived class.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
Hi!
I have panel control and a picture box in it with SizeMode = Stretch. AutoScroll property of the Panel control is true. The picture box contains an image large enough to show the scroll bars of the panel control.
A rectangle is drawn over the image with different location and size.
Rectangle size always less than the display area of the panel control.
How can I scroll to the Drawn rectangle so that the drawn rectangle is completely visible in the Display area of the Panel control?
Thank You.
|
|
|
|
|
Hi.
How I can take a icon witch is asociated with file? I want to add it a ListView with fileName. Is there any quick way to compare two icons? I dont want to make a big table witch contains every icon in the folder, because lots of them are the same.
Thx!
|
|
|
|
|
You will have to use the Win32 API for that. It involves getting information about threads, modules, and processes and then using this info with Win32 function that will retrieve handle to file icon. It is not a cake walk if you have never worked with the Win32 before.
|
|
|
|
|
Hello everybody,
I have to integrate a webservice into a stand alone C# application. I do not have the WSDL but I have the URL of the Webservice, the service name, the operation name and the parameters (one single string containing a XML formated message). The web service returns the required information in the same parameter also formated as XML. The service is mounted with SOAP over RPC.
How can I do it? Do I try to create my own WSDL by hand?
Thank you to everybody who reads the message.
Best Regards,
Marcos
|
|
|
|