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

PropertyGrid and Custom editing/formatting

Hi there

I have a Propertygrid in a C# project that has a number of IP addresses
displayed.
What I would like to do is to a) Edit them in-place as the 4 octets, ie
edit them as xxx.xxx.xxx.xxx possibly using the IPControl, and b) validate
them on losing focus in the editing area.

I've done a lot of googling, and frankly, I am now confused!

Can anyone please point me as to how to do what I want. I'm not an expert in
C#, but have done some work using it

Thanks in advance!

Hugh
Dec 6 '07 #1
4 4015
Hugh,

AFAIK, you won't be able to change the control in the property grid to
be an IPControl. The best you could do is have an IPControl in a drop down
that the grid exposes for you, or a dialog that the grid pops up for you.

You might be able to create a custom class which exposes the four octets
of the IP address and then expose that on the object that you are placing
the IP addresses in. Then, you would be able to expand the object and edit
the individual octets in the grid.

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

"Hugh" <Hu**@discussions.microsoft.comwrote in message
news:0B**********************************@microsof t.com...
Hi there

I have a Propertygrid in a C# project that has a number of IP addresses
displayed.
What I would like to do is to a) Edit them in-place as the 4 octets, ie
edit them as xxx.xxx.xxx.xxx possibly using the IPControl, and b) validate
them on losing focus in the editing area.

I've done a lot of googling, and frankly, I am now confused!

Can anyone please point me as to how to do what I want. I'm not an expert
in
C#, but have done some work using it

Thanks in advance!

Hugh

Dec 6 '07 #2
Thanks Nicholas, not the answer I was hoping for, but certainly the answer I
was expecting.

Wouldn't it be nice if the PropertyGrid had the ability to hook different
controls in :-)

"Nicholas Paldino [.NET/C# MVP]" wrote:
Hugh,

AFAIK, you won't be able to change the control in the property grid to
be an IPControl. The best you could do is have an IPControl in a drop down
that the grid exposes for you, or a dialog that the grid pops up for you.

You might be able to create a custom class which exposes the four octets
of the IP address and then expose that on the object that you are placing
the IP addresses in. Then, you would be able to expand the object and edit
the individual octets in the grid.

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

"Hugh" <Hu**@discussions.microsoft.comwrote in message
news:0B**********************************@microsof t.com...
Hi there

I have a Propertygrid in a C# project that has a number of IP addresses
displayed.
What I would like to do is to a) Edit them in-place as the 4 octets, ie
edit them as xxx.xxx.xxx.xxx possibly using the IPControl, and b) validate
them on losing focus in the editing area.

I've done a lot of googling, and frankly, I am now confused!

Can anyone please point me as to how to do what I want. I'm not an expert
in
C#, but have done some work using it

Thanks in advance!

Hugh


Dec 7 '07 #3
Depending on your budget, there are 3rd-party tools that might help,
such as VisualHint. I evaluated this one a while ago and was quite
impressed, but the project scope changed and it became unnecessary.

http://www.visualhint.com/index.php/propertygrid/

Marc
Dec 7 '07 #4
Hello Hugh,

First of all, Marc, thanks a lot for the kind words. I must add that
in the next release of Smart FieldPackEditor, there is a new ip
address inplace editor for Smart PropertyGrid.

Hugh, if a commercial product is an option for you I recommend you to
try the demos of both products. You may find that this is exactly what
you need.

Best regards,

Nicolas Cadilhac @ VisualHint (http://www.visualhint.com)
Home of Smart FieldPackEditor.Net / DateTimePicker replacement (http://
www.visualhint.com/index.php/fieldpackeditor)
Home of Smart PropertyGrid for .Net and MFC (http://www.visualhint.com/
index.php/propertygrid)
Microsoft PropertyGrid Resource List - http://www.propertygridresourcelist.com

On Dec 7, 5:00 am, Marc Gravell <marc.grav...@gmail.comwrote:
Depending on your budget, there are 3rd-party tools that might help,
such as VisualHint. I evaluated this one a while ago and was quite
impressed, but the project scope changed and it became unnecessary.

http://www.visualhint.com/index.php/propertygrid/

Marc
Dec 9 '07 #5

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

Similar topics

8
by: Chris Dunaway | last post by:
When using a PropertyGrid, I have an object with a Date property, but I am only interested in the Time portion. How do I make the PropertyGrid allow editing the time only? Just the hours and...
2
by: Chris Dunaway | last post by:
I am using the PropertyGrid and I have set the SelectedObject property to an instance of my custom class. One of the properties of the custom class is a bitmap. The PropertyGrid lets me assign...
1
by: margoulin | last post by:
hello, i'm currently using a PropertyGrid to monitor the properties of some numerical objects, mainly composed of ints and floats that must stay in a specific range. The logical choice for...
1
by: newbie | last post by:
Hello, I maybe asking too much in a single posting, but here it goes: I building a windows form that mimic's the Outlook XP GUI. Its a three pane form that will allow a user to view and edit...
4
by: Alexander Wehrli | last post by:
Hi, Two questions about PropertyGrid: 1. How can I achieve that one value in a PropertyGrid is treated as a Password (like TextBox.PasswordChar behaviour) ? 2. If you edit a TabControl in...
1
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...
4
by: ljlevend | last post by:
Is there any way to prevent a PropertyGrid from allowing the user to expand the elements of an array? For properties that are of type ArrayList or CollectionBase a PropertyGrid only allows the...
0
by: taskswap | last post by:
I've successfully set up a PropertyGrid using custom editors and type converters. They work very well. However, I have a spot where I want to generate the TypeConverter converter entries on the fly...
1
by: Ron M. Newman | last post by:
Hi, Simple imaginary problem: 1) I have a class with three integers in it. 2) An object of this class is a member of a class I will submit to a propertygrid 3) I want to have a custom dialog...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.