Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8495909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:42:24+00:00 2026-06-10T23:42:24+00:00

I define item in propertygrid. My code is here : [DisplayName(Title of book), CategoryAttribute(Books)]

  • 0

I define item in propertygrid. My code is here :

[DisplayName("Title of book"), CategoryAttribute("Books")]
public string BookName{ get; set; }

With this code , I can get Labele and value of this item from propertygrid(for this example : Title of book and value of it (for example) Learning C#):

private void button1_Click(object sender, EventArgs e)
{
    GridItem gi = propertyGrid1.SelectedGridItem;
    while (gi.Parent != null)
    {
        gi = gi.Parent;
    }
    foreach (GridItem item in gi.GridItems)
    {
        ParseGridItems(item); //recursive
    }
}

private void ParseGridItems(GridItem gi)
{
    if (gi.GridItemType == GridItemType.Category)
    {
        foreach (GridItem item in gi.GridItems)
        {
            ParseGridItems(item);
        }
    }
    textBox1.Text += "Lable : "+gi.Label + "\r\n";
    if(gi.Value != null)
        textBox1.Text += "Value : " + gi.Value.ToString() + "\r\n";
}

How can I get the item name ? for this example : BookName

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:42:26+00:00Added an answer on June 10, 2026 at 11:42 pm

    Use GridItem.PropertyDescriptor property:

    var propertyName = propertyGrid1.SelectedGridItem.PropertyDescriptor.Name;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this class public class Item { public Coordinate coordinate { get; set;
I define enums: enum itemType {First, Second, Third}; public class Item { private itemType
###MyClass.h### #ifndef _MyClass #define _MyClass #include <string> using namespace std; class MyClass { public:
How can i define each menu item in different line? Right now if I'm
I am trying to define a composite list item in an Android ListView but
I am using simple navigation and I am trying to define a path: sub_nav.item
I'm trying to get an item from a list at a given index for
I have this macro code, which allows me to define both a C enum
I'm trying to define a template member inside a template class. Here is a
Part of My Item Model: Ext.define('DnD.model.Item', { extend: 'Ext.data.Model', idProperty:'item_number', associations: [{ type: 'belongsTo',

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.