PropertyGrid-Need HELP

G

Guest

Im new to PropertyGrid .
I dont know how to set the property of the object that is changed in the
property grid . All that my form has relative to propertygrid is :

propertygrid.SelectedObject=first; //object

private void propertygrid_PropertyValueChanged(object s,
System.Windows.Forms.PropertyValueChangedEventArgs e)
{
MessageBox.Show( propertygrid.SelectedGridItem.ToString());
/*My intension is first.
propertygrid.SelectedGridItem.ToString()=propertygrid.SelectedGridItem.ToString());*/
/*I know "first" is an object and this is not possible directly . */
}


If i can get a simple code to do this at this moment it would be very useful.
Thanks in advance .
 
G

Guest

I think i wasnt quite clear the last time . Maybe i need to rephrase my
problem.
The one in the codeproject is the same what i am doing . I just checked it .
It also has
propertyGrid1.SelectedObject = textBox1;
Instead of testBox1 i have my object called "first".
This object has certain properties like A,B & C.
I can see it and i can change it in the property grid.
But I need to SAVE it .Thats inside the object "first".
Inorder to do that im able to get the name of the property what the
user selects i.e., A or B or C. using SelectedGridItem.
--
deepak


TOM said:
Check The Code Project. They've had several good C# articles using the
Property Grid.

http://www.codeproject.com search for propertygrid in articles

A specific one that may be helpful:

http://www.codeproject.com/csharp/PropertyGrid.asp

I'm not sure of the syntax in C#, but in C++ you label the properties with
the
[ attributes ] descriptions.

-- Tom






Deepak said:
Im new to PropertyGrid .
I dont know how to set the property of the object that is changed in the
property grid . All that my form has relative to propertygrid is :

propertygrid.SelectedObject=first; //object

private void propertygrid_PropertyValueChanged(object s,
System.Windows.Forms.PropertyValueChangedEventArgs e)
{
MessageBox.Show( propertygrid.SelectedGridItem.ToString());
/*My intension is first.
propertygrid.SelectedGridItem.ToString()=propertygrid.SelectedGridItem.ToString());*/
/*I know "first" is an object and this is not possible directly . */
}


If i can get a simple code to do this at this moment it would be very
useful.
Thanks in advance .
 

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

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top