Groups | Blog | Home
all groups > dotnet faqs > july 2005 >

dotnet faqs : PropertyGrid-Need HELP



Deepak
7/14/2005 9:07:05 AM
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 .
--
TOM
7/14/2005 6:30:25 PM
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






[quoted text, click to view]

Deepak
7/15/2005 1:40:03 AM
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


[quoted text, click to view]
AddThis Social Bookmark Button