PropertyGrid-Need HELP

Discussion in 'ASP .Net' started by =?Utf-8?B?RGVlcGFr?=, Jul 14, 2005.

  1. 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 .
    --
    deepak
    =?Utf-8?B?RGVlcGFr?=, Jul 14, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?RGVlcGFr?=

    TOM Guest

    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" <> wrote in message
    news:...
    > 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 .
    > --
    > deepak
    TOM, Jul 15, 2005
    #2
    1. Advertising

  3. 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" wrote:

    > 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" <> wrote in message
    > news:...
    > > 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 .
    > > --
    > > deepak

    >
    >
    >
    =?Utf-8?B?RGVlcGFr?=, Jul 15, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave Wurtz

    PropertyGrid - ReadOnly

    Dave Wurtz, Nov 13, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,827
    Dave Wurtz
    Nov 14, 2003
  2. Jéjé
    Replies:
    1
    Views:
    437
    Jéjé
    Jan 24, 2004
  3. JezB

    PropertyGrid for ASP.NET

    JezB, Apr 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    434
  4. Wilmer Rignack
    Replies:
    0
    Views:
    403
    Wilmer Rignack
    Feb 22, 2005
  5. =?Utf-8?B?Sm9u?=

    ASP.net PropertyGrid

    =?Utf-8?B?Sm9u?=, May 13, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,250
    gaidar
    May 14, 2005
Loading...

Share This Page