PropertyGrid and Custom editing/formatting

  • Thread starter Thread starter Hugh
  • Start date Start date
H

Hugh

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
 
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.
 
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 said:
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]
- (e-mail address removed)

Hugh said:
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top