{"id":711,"date":"2011-04-19T03:02:49","date_gmt":"2011-04-19T10:02:49","guid":{"rendered":"https:\/\/wordpress-1325650-4848760.cloudwaysapps.com\/?p=711"},"modified":"2025-04-27T18:23:51","modified_gmt":"2025-04-27T22:23:51","slug":"wpf-property-grid-tutorial","status":"publish","type":"post","link":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial","title":{"rendered":"WPF Property Grid (WPG) Tutorial In C#"},"content":{"rendered":"\n<p>Have you ever struggled with creating complex forms with dozens of input fields in your <a href=\"https:\/\/codesamplez.com\/development\/getting-started-with-wpf-in-c-sharp\" target=\"_blank\" rel=\"noreferrer noopener\">WPF<\/a> application? I know I have, and it&#8217;s a pain! That&#8217;s exactly why I&#8217;m excited to share this comprehensive guide about the WPF Property Grid &#8211; an absolute game-changer for anyone developing data-heavy applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is a WPF Property Grid and Why Should You Care?<\/h2>\n\n\n\n<p>A Property Grid is a powerful UI control that automatically generates input controls based on properties defined in your C# classes. It&#8217;s the same type of control that powers Visual Studio&#8217;s Properties window, allowing users to view and edit object properties in a neat, organized panel. For applications that require numerous input fields, property grids are an incredible time-saver.<\/p>\n\n\n\n<p>Instead of manually designing each field in XAML, you can simply define a class with the properties you need, apply some attributes, and the Property Grid does all the heavy lifting for you. The result? Clean, consistent UIs with much less code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How Does a WPF Property Grid Work?<\/h2>\n\n\n\n<p>The Property Grid works through a simple but powerful concept &#8211; it uses reflection to analyze your class properties and generates appropriate UI controls based on their types. Here&#8217;s the basic mechanism:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You define a class with properties you want to display and edit<\/li>\n\n\n\n<li>You decorate those properties with attributes to control their appearance and behavior<\/li>\n\n\n\n<li>The Property Grid renders the appropriate controls based on property types<\/li>\n\n\n\n<li>Changes made by users are automatically applied back to your object<\/li>\n<\/ol>\n\n\n\n<p>For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>String properties<\/strong> become text boxes<\/li>\n\n\n\n<li><strong>Boolean properties<\/strong> become checkboxes<\/li>\n\n\n\n<li><strong>Enum properties<\/strong> become dropdown lists<\/li>\n\n\n\n<li><strong>Numeric properties<\/strong> become up\/down controls<\/li>\n\n\n\n<li><strong>DateTime properties<\/strong> become date pickers<\/li>\n<\/ul>\n\n\n\n<p>You can further customize the appearance using attributes that define categories, display names, descriptions, validation rules, and more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Best Property Grid Libraries for WPF<\/h2>\n\n\n\n<p>While WPF doesn&#8217;t include a built-in property grid, several excellent third-party options are available. Here are the top choices in 2025:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><a href=\"https:\/\/github.com\/xceedsoftware\/wpftoolkit\" target=\"_blank\" rel=\"noreferrer noopener\">Extended WPF Toolkit<\/a><\/strong> &#8211; A comprehensive collection of WPF controls including an excellent Property Grid<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/www.devexpress.com\/products\/net\/controls\/wpf\/\" target=\"_blank\" rel=\"noreferrer noopener\">DevExpress WPF Controls<\/a><\/strong> &#8211; A commercial library with a feature-rich Property Grid supporting DateOnly\/TimeOnly properties as of 2024<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/help.syncfusion.com\/wpf\/propertygrid\/getting-started\" target=\"_blank\" rel=\"noreferrer noopener\">Syncfusion PropertyGrid<\/a><\/strong> &#8211; A flexible commercial option with extensive customization<\/li>\n\n\n\n<li><strong><a href=\"https:\/\/github.com\/DenysVuika\/WPG\" target=\"_blank\" rel=\"noreferrer noopener\">WPG (WPF Property Grid)<\/a><\/strong> &#8211; An open-source solution that we&#8217;ll explore in this tutorial<\/li>\n<\/ol>\n\n\n\n<p>For this tutorial, we&#8217;ll focus on WPG, as it&#8217;s free, open-source, and provides a solid foundation for understanding property grid concepts.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implementing a Property Grid with WPG<\/h2>\n\n\n\n<p>Let&#8217;s dive into implementation with a step-by-step guide using the WPG library. While the original WPG was hosted on CodePlex (which has been shut down), the project has been preserved on GitHub and can still be used effectively.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Setting Up Your Project<\/h3>\n\n\n\n<p>First, you&#8217;ll need to add the WPG library to your project. You can:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Use <a href=\"https:\/\/www.nuget.org\/\">NuGet<\/a> Package Manager (if available)<\/li>\n\n\n\n<li>Download and reference the DLL files directly<\/li>\n\n\n\n<li>Clone the source code from GitHub and build it yourself<\/li>\n<\/ol>\n\n\n\n<p>For simplicity, I recommend downloading the compiled DLLs and adding them as references to your project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Creating Your Property Grid Class<\/h3>\n\n\n\n<p>Now, let&#8217;s create a class that will define the properties to display in our grid:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">using System;\nusing System.ComponentModel;\nusing System.Xml.Serialization;\n\nnamespace PropertyGridClasses\n{\n    public <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">MyPropertyGrid<\/span>\n    <\/span>{\n        <span class=\"hljs-comment\">\/\/ Enum for dropdown selection<\/span>\n        public enum ETestEnum { Option1, Option2, Option3 }\n        \n        <span class=\"hljs-comment\">\/\/ Category organization with display name and tooltip<\/span>\n        &#91;CategoryAttribute(<span class=\"hljs-string\">\"Category 1\"<\/span>),\n        DisplayName(<span class=\"hljs-string\">\"Choose an Option\"<\/span>),\n        DescriptionAttribute(<span class=\"hljs-string\">\"Select one of the available options\"<\/span>)]\n        public ETestEnum ComboData { <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>; }\n        \n        &#91;CategoryAttribute(\"Category 2\"),\n        DisplayName(\"Numeric Value\"),\n        DescriptionAttribute(\"Enter a numeric value between 0 and 100\")]\n        &#91;Range(0, 100)] \/\/ Adding validation\n        public int MyNumericUpdown { <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>; }\n        \n        &#91;CategoryAttribute(\"Category 2\"),\n        DisplayName(\"Text Input\"),\n        DescriptionAttribute(\"Enter some text here\")]\n        public string MyTextbox { <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>; }\n        \n        &#91;CategoryAttribute(\"Category 3\"),\n        DisplayName(\"Date Selection\"),\n        DescriptionAttribute(\"Select a date\")]\n        public DateTime MyDate { <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>; }\n        \n        &#91;CategoryAttribute(\"Category 3\"),\n        DisplayName(\"Enable Feature\"),\n        DescriptionAttribute(\"Toggle this feature on or off\")]\n        public bool MyToggle { <span class=\"hljs-keyword\">get<\/span>; <span class=\"hljs-keyword\">set<\/span>; }\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Notice how we&#8217;ve:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Used <strong>CategoryAttribute<\/strong> to organize properties into collapsible groups<\/li>\n\n\n\n<li>Applied <strong>DisplayName<\/strong> to provide user-friendly labels<\/li>\n\n\n\n<li>Added <strong>DescriptionAttribute<\/strong> for helpful tooltips<\/li>\n\n\n\n<li>Included a <strong>Range<\/strong> attribute for validation (if your library supports it)<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Adding the Property Grid to Your XAML<\/h3>\n\n\n\n<p>Next, let&#8217;s add the property grid control to our XAML file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Window<\/span> <span class=\"hljs-attr\">x:Class<\/span>=<span class=\"hljs-string\">\"WpfApplication1.MainWindow\"<\/span>\n        <span class=\"hljs-attr\">xmlns<\/span>=<span class=\"hljs-string\">\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"<\/span>\n        <span class=\"hljs-attr\">xmlns:x<\/span>=<span class=\"hljs-string\">\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"<\/span>\n        <span class=\"hljs-attr\">xmlns:wpg<\/span>=<span class=\"hljs-string\">\"clr-namespace:WPG;assembly=WPG\"<\/span>\n        <span class=\"hljs-attr\">Title<\/span>=<span class=\"hljs-string\">\"Property Grid Demo\"<\/span> <span class=\"hljs-attr\">Height<\/span>=<span class=\"hljs-string\">\"450\"<\/span> <span class=\"hljs-attr\">Width<\/span>=<span class=\"hljs-string\">\"600\"<\/span> <span class=\"hljs-attr\">Loaded<\/span>=<span class=\"hljs-string\">\"Window_Loaded\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Grid<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Grid.ColumnDefinitions<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ColumnDefinition<\/span> <span class=\"hljs-attr\">Width<\/span>=<span class=\"hljs-string\">\"*\"<\/span>\/&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ColumnDefinition<\/span> <span class=\"hljs-attr\">Width<\/span>=<span class=\"hljs-string\">\"*\"<\/span>\/&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Grid.ColumnDefinitions<\/span>&gt;<\/span>\n        \n        <span class=\"hljs-comment\">&lt;!-- Property Grid Control --&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">wpg:PropertyGrid<\/span> \n            <span class=\"hljs-attr\">Grid.Column<\/span>=<span class=\"hljs-string\">\"0\"<\/span>\n            <span class=\"hljs-attr\">AutomaticlyExpandObjects<\/span>=<span class=\"hljs-string\">\"False\"<\/span> \n            <span class=\"hljs-attr\">Width<\/span>=<span class=\"hljs-string\">\"320\"<\/span> \n            <span class=\"hljs-attr\">Margin<\/span>=<span class=\"hljs-string\">\"10\"<\/span>\n            <span class=\"hljs-attr\">x:Name<\/span>=<span class=\"hljs-string\">\"wpgMyControl\"<\/span> \n            <span class=\"hljs-attr\">ShowDescription<\/span>=<span class=\"hljs-string\">\"True\"<\/span> \n            <span class=\"hljs-attr\">ShowPreview<\/span>=<span class=\"hljs-string\">\"True\"<\/span> \/&gt;<\/span>\n        \n        <span class=\"hljs-comment\">&lt;!-- Right panel for additional content --&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">StackPanel<\/span> <span class=\"hljs-attr\">Grid.Column<\/span>=<span class=\"hljs-string\">\"1\"<\/span> <span class=\"hljs-attr\">Margin<\/span>=<span class=\"hljs-string\">\"10\"<\/span>&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">TextBlock<\/span> <span class=\"hljs-attr\">Text<\/span>=<span class=\"hljs-string\">\"Property Values:\"<\/span> <span class=\"hljs-attr\">FontWeight<\/span>=<span class=\"hljs-string\">\"Bold\"<\/span> <span class=\"hljs-attr\">Margin<\/span>=<span class=\"hljs-string\">\"0,0,0,10\"<\/span>\/&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">Button<\/span> <span class=\"hljs-attr\">Content<\/span>=<span class=\"hljs-string\">\"Get Values\"<\/span> <span class=\"hljs-attr\">Click<\/span>=<span class=\"hljs-string\">\"GetValues_Click\"<\/span> <span class=\"hljs-attr\">Margin<\/span>=<span class=\"hljs-string\">\"0,10,0,0\"<\/span>\/&gt;<\/span>\n            <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">TextBlock<\/span> <span class=\"hljs-attr\">x:Name<\/span>=<span class=\"hljs-string\">\"txtValues\"<\/span> <span class=\"hljs-attr\">Margin<\/span>=<span class=\"hljs-string\">\"0,10,0,0\"<\/span> <span class=\"hljs-attr\">TextWrapping<\/span>=<span class=\"hljs-string\">\"Wrap\"<\/span>\/&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">StackPanel<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Grid<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">Window<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Step 4: Connecting Everything in the Code-Behind<\/h3>\n\n\n\n<p>Finally, let&#8217;s hook everything up in our C# code-behind file:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">using System;\nusing System.Windows;\nusing PropertyGridClasses;\n\n<span class=\"hljs-keyword\">namespace<\/span> <span class=\"hljs-title\">WpfApplication1<\/span>\n{\n    <span class=\"hljs-title\">public<\/span> <span class=\"hljs-title\">partial<\/span> <span class=\"hljs-title\">class<\/span> <span class=\"hljs-title\">MainWindow<\/span> : <span class=\"hljs-title\">Window<\/span>\n    {\n        <span class=\"hljs-title\">private<\/span> <span class=\"hljs-title\">MyPropertyGrid<\/span> <span class=\"hljs-title\">_propertyObject<\/span>;\n        \n        <span class=\"hljs-keyword\">public<\/span> MainWindow()\n        {\n            InitializeComponent();\n        }\n        \n        <span class=\"hljs-keyword\">private<\/span> void Window_Loaded(object sender, RoutedEventArgs e)\n        {\n            <span class=\"hljs-comment\">\/\/ Create instance of our property class<\/span>\n            _propertyObject = <span class=\"hljs-keyword\">new<\/span> MyPropertyGrid\n            {\n                <span class=\"hljs-comment\">\/\/ Set default values<\/span>\n                ComboData = MyPropertyGrid.ETestEnum.Option1,\n                MyNumericUpdown = <span class=\"hljs-number\">50<\/span>,\n                MyTextbox = <span class=\"hljs-string\">\"Hello World\"<\/span>,\n                MyDate = DateTime.Now,\n                MyToggle = <span class=\"hljs-keyword\">true<\/span>\n            };\n            \n            <span class=\"hljs-comment\">\/\/ Assign to property grid<\/span>\n            wpgMyControl.Instance = _propertyObject;\n        }\n        \n        <span class=\"hljs-keyword\">private<\/span> void GetValues_Click(object sender, RoutedEventArgs e)\n        {\n            <span class=\"hljs-comment\">\/\/ Access property values directly from your object<\/span>\n            txtValues.Text = $<span class=\"hljs-string\">\"Selected option: {_propertyObject.ComboData}\\n\"<\/span> +\n                            $<span class=\"hljs-string\">\"Numeric value: {_propertyObject.MyNumericUpdown}\\n\"<\/span> +\n                            $<span class=\"hljs-string\">\"Text value: {_propertyObject.MyTextbox}\\n\"<\/span> +\n                            $<span class=\"hljs-string\">\"Date: {_propertyObject.MyDate.ToShortDateString()}\\n\"<\/span> +\n                            $<span class=\"hljs-string\">\"Toggle: {_propertyObject.MyToggle}\"<\/span>;\n        }\n    }\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>When you run this application, you&#8217;ll see a property grid with fields automatically generated based on your class properties, organized into categories, with appropriate controls for each property type.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Advantages of Using a WPF Property Grid<\/h2>\n\n\n\n<p>Property grids offer several compelling benefits that can dramatically improve your development workflow:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Massive code reduction<\/strong> &#8211; No need to manually create and position dozens of UI controls<\/li>\n\n\n\n<li><strong>Consistency<\/strong> &#8211; Uniform appearance and behavior across all properties<\/li>\n\n\n\n<li><strong>Easy maintenance<\/strong> &#8211; Adding or removing fields is as simple as modifying your class<\/li>\n\n\n\n<li><strong>Organized interface<\/strong> &#8211; Categories help organize large numbers of properties<\/li>\n\n\n\n<li><strong>Built-in features<\/strong> &#8211; Search, filtering, and collapsible categories come standard<\/li>\n\n\n\n<li><strong>Time-saving<\/strong> &#8211; Perfect for applications with complex data entry requirements<\/li>\n\n\n\n<li><strong>Familiar UX<\/strong> &#8211; Users recognize the pattern from Visual Studio and other applications<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Potential Limitations to Consider<\/h2>\n\n\n\n<p>While property grids are fantastic for many scenarios, they do have some limitations:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Less customizable layout<\/strong> &#8211; You&#8217;re somewhat constrained by the grid format<\/li>\n\n\n\n<li><strong>Learning curve for customization<\/strong> &#8211; Advanced scenarios require a deeper understanding<\/li>\n\n\n\n<li><strong>Limited control over the UI<\/strong> &#8211; Some libraries have more styling options than others<\/li>\n\n\n\n<li><strong>Not ideal for every scenario<\/strong> &#8211; Simple forms might be better with traditional controls<\/li>\n\n\n\n<li><strong>Event handling can be tricky<\/strong> &#8211; Some implementations make it challenging to respond to individual property changes<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Modern Alternatives Worth Considering<\/h2>\n\n\n\n<p>In 2025, several alternatives to traditional property grids have emerged:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>MaterialDesignXAML<\/strong> &#8211; Offers modern-looking property editors with Material Design styling<\/li>\n\n\n\n<li><strong>ReactiveUI PropertyGrid<\/strong> &#8211; Combines the power of ReactiveUI with property grid functionality<\/li>\n\n\n\n<li><strong>Custom DataGrid-based solutions<\/strong> &#8211; Some developers create customized implementations based on the WPF DataGrid<\/li>\n\n\n\n<li><strong>MVVM Framework property editors<\/strong> &#8211; Libraries like Caliburn.Micro offer property editing capabilities<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices for WPF Property Grids<\/h2>\n\n\n\n<p>To get the most out of your property grid implementation:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Use descriptive categories<\/strong> &#8211; Group related properties logically<\/li>\n\n\n\n<li><strong>Provide helpful descriptions<\/strong> &#8211; Users should understand what each property does<\/li>\n\n\n\n<li><strong>Use custom editors for complex types<\/strong> &#8211; Don&#8217;t rely on the default editors for everything<\/li>\n\n\n\n<li><strong>Implement data validation<\/strong> &#8211; Use attributes or IDataErrorInfo to validate input<\/li>\n\n\n\n<li><strong>Consider read-only properties<\/strong> &#8211; Not everything needs to be editable<\/li>\n\n\n\n<li><strong>Test with different screen resolutions<\/strong> &#8211; Property grids can behave differently on various displays<\/li>\n\n\n\n<li><strong>Implement search functionality<\/strong> &#8211; For grids with many properties, search becomes essential<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The WPF Property Grid is an incredibly powerful tool that can dramatically improve your development efficiency when building data-heavy applications. By automatically generating UI controls from your class properties, it eliminates countless hours of tedious UI design work.<\/p>\n\n\n\n<p>While the original WPG library mentioned in this tutorial may have limitations, numerous modern alternatives now exist that provide enhanced functionality and better integration with current development practices. Whether you choose an open-source solution or a commercial library, the property grid pattern remains one of the most efficient ways to handle complex property editing in WPF applications.<\/p>\n\n\n\n<p>Have you used property grids in your projects? What has been your experience? Let me know in the comments below!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Recommended Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/xceedsoftware\/wpftoolkit\">Extended WPF Toolkit Documentation<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.devexpress.com\/products\/net\/controls\/wpf\/\">DevExpress WPF Controls<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.syncfusion.com\/wpf-controls\/property-grid\">Syncfusion WPF Property Grid<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.windows.forms.propertygrid\">MSDN Documentation on PropertyGrid<\/a><\/li>\n<\/ul>\n\n\n\n<p>Happy coding! \ud83d\ude0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article provides a beginner-friendly guide to implementing a property grid in WPF applications using C#. It explains how to automatically generate UI controls based on class properties and attributes like Category, DisplayName, and Description. The tutorial includes practical code examples for setting up and customizing the property grid, highlighting its advantages such as simplicity, code reduction as well as noting limitations like limited customization and event handling challenges.<\/p>\n","protected":false},"author":1,"featured_media":58477,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[11],"tags":[15,4,28],"class_list":{"0":"post-711","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-development","8":"tag-net","9":"tag-c-sharp","10":"tag-wpf","11":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>WPF Property Grid (WPG) Tutorial In C# - CodeSamplez.com<\/title>\n<meta name=\"description\" content=\"Learn how to implement a WPF Property Grid in your C# applications to generate UI controls from class properties automatically.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WPF Property Grid (WPG) Tutorial In C#\" \/>\n<meta property=\"og:description\" content=\"Learn how to implement a WPF Property Grid in your C# applications to generate UI controls from class properties automatically.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial\" \/>\n<meta property=\"og:site_name\" content=\"CodeSamplez.com\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codesamplez\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ranacseruet\" \/>\n<meta property=\"article:published_time\" content=\"2011-04-19T10:02:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-04-27T22:23:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codesamplez.com\/wp-content\/uploads\/2011\/04\/wpf-property-grid-c-sharp.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Rana Ahsan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ranacseruet\" \/>\n<meta name=\"twitter:site\" content=\"@codesamplez\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rana Ahsan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial\"},\"author\":{\"name\":\"Rana Ahsan\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#\\\/schema\\\/person\\\/a82c3c07205f4bb73d6b3b0906bc328b\"},\"headline\":\"WPF Property Grid (WPG) Tutorial In C#\",\"datePublished\":\"2011-04-19T10:02:49+00:00\",\"dateModified\":\"2025-04-27T22:23:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial\"},\"wordCount\":1119,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2011\\\/04\\\/wpf-property-grid-c-sharp.webp\",\"keywords\":[\".net\",\"c#\",\"wpf\"],\"articleSection\":[\"Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial\",\"name\":\"WPF Property Grid (WPG) Tutorial In C# - CodeSamplez.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2011\\\/04\\\/wpf-property-grid-c-sharp.webp\",\"datePublished\":\"2011-04-19T10:02:49+00:00\",\"dateModified\":\"2025-04-27T22:23:51+00:00\",\"description\":\"Learn how to implement a WPF Property Grid in your C# applications to generate UI controls from class properties automatically.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial#primaryimage\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2011\\\/04\\\/wpf-property-grid-c-sharp.webp\",\"contentUrl\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2011\\\/04\\\/wpf-property-grid-c-sharp.webp\",\"width\":1536,\"height\":1024,\"caption\":\"WPF Property Grid in C#.NET\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/development\\\/wpf-property-grid-tutorial#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/codesamplez.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WPF Property Grid (WPG) Tutorial In C#\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#website\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/\",\"name\":\"CODESAMPLEZ.COM\",\"description\":\"Programming And Development Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/codesamplez.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#organization\",\"name\":\"codesamplez.com\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/cropped-favicon.webp\",\"contentUrl\":\"https:\\\/\\\/codesamplez.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/cropped-favicon.webp\",\"width\":512,\"height\":512,\"caption\":\"codesamplez.com\"},\"image\":{\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codesamplez\",\"https:\\\/\\\/x.com\\\/codesamplez\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/codesamplez.com\\\/#\\\/schema\\\/person\\\/a82c3c07205f4bb73d6b3b0906bc328b\",\"name\":\"Rana Ahsan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g\",\"caption\":\"Rana Ahsan\"},\"description\":\"Rana Ahsan is a seasoned software engineer and technology leader specialized in distributed systems and software architecture. With a Master\u2019s in Software Engineering from Concordia University, his experience spans leading scalable architecture at Coursera and TopHat, contributing to open-source projects. This blog, CodeSamplez.com, showcases his passion for sharing practical insights on programming and distributed systems concepts and help educate others. Github | X | LinkedIn\",\"sameAs\":[\"https:\\\/\\\/github.com\\\/ranacseruet\",\"https:\\\/\\\/www.facebook.com\\\/ranacseruet\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ranacseruet\\\/\",\"https:\\\/\\\/x.com\\\/ranacseruet\"],\"url\":\"https:\\\/\\\/codesamplez.com\\\/author\\\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"WPF Property Grid (WPG) Tutorial In C# - CodeSamplez.com","description":"Learn how to implement a WPF Property Grid in your C# applications to generate UI controls from class properties automatically.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial","og_locale":"en_US","og_type":"article","og_title":"WPF Property Grid (WPG) Tutorial In C#","og_description":"Learn how to implement a WPF Property Grid in your C# applications to generate UI controls from class properties automatically.","og_url":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial","og_site_name":"CodeSamplez.com","article_publisher":"https:\/\/www.facebook.com\/codesamplez","article_author":"https:\/\/www.facebook.com\/ranacseruet","article_published_time":"2011-04-19T10:02:49+00:00","article_modified_time":"2025-04-27T22:23:51+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/codesamplez.com\/wp-content\/uploads\/2011\/04\/wpf-property-grid-c-sharp.webp","type":"image\/webp"}],"author":"Rana Ahsan","twitter_card":"summary_large_image","twitter_creator":"@ranacseruet","twitter_site":"@codesamplez","twitter_misc":{"Written by":"Rana Ahsan","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial#article","isPartOf":{"@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial"},"author":{"name":"Rana Ahsan","@id":"https:\/\/codesamplez.com\/#\/schema\/person\/a82c3c07205f4bb73d6b3b0906bc328b"},"headline":"WPF Property Grid (WPG) Tutorial In C#","datePublished":"2011-04-19T10:02:49+00:00","dateModified":"2025-04-27T22:23:51+00:00","mainEntityOfPage":{"@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial"},"wordCount":1119,"commentCount":4,"publisher":{"@id":"https:\/\/codesamplez.com\/#organization"},"image":{"@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial#primaryimage"},"thumbnailUrl":"https:\/\/codesamplez.com\/wp-content\/uploads\/2011\/04\/wpf-property-grid-c-sharp.webp","keywords":[".net","c#","wpf"],"articleSection":["Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial","url":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial","name":"WPF Property Grid (WPG) Tutorial In C# - CodeSamplez.com","isPartOf":{"@id":"https:\/\/codesamplez.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial#primaryimage"},"image":{"@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial#primaryimage"},"thumbnailUrl":"https:\/\/codesamplez.com\/wp-content\/uploads\/2011\/04\/wpf-property-grid-c-sharp.webp","datePublished":"2011-04-19T10:02:49+00:00","dateModified":"2025-04-27T22:23:51+00:00","description":"Learn how to implement a WPF Property Grid in your C# applications to generate UI controls from class properties automatically.","breadcrumb":{"@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial#primaryimage","url":"https:\/\/codesamplez.com\/wp-content\/uploads\/2011\/04\/wpf-property-grid-c-sharp.webp","contentUrl":"https:\/\/codesamplez.com\/wp-content\/uploads\/2011\/04\/wpf-property-grid-c-sharp.webp","width":1536,"height":1024,"caption":"WPF Property Grid in C#.NET"},{"@type":"BreadcrumbList","@id":"https:\/\/codesamplez.com\/development\/wpf-property-grid-tutorial#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codesamplez.com\/"},{"@type":"ListItem","position":2,"name":"WPF Property Grid (WPG) Tutorial In C#"}]},{"@type":"WebSite","@id":"https:\/\/codesamplez.com\/#website","url":"https:\/\/codesamplez.com\/","name":"CODESAMPLEZ.COM","description":"Programming And Development Resources","publisher":{"@id":"https:\/\/codesamplez.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codesamplez.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codesamplez.com\/#organization","name":"codesamplez.com","url":"https:\/\/codesamplez.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codesamplez.com\/#\/schema\/logo\/image\/","url":"https:\/\/codesamplez.com\/wp-content\/uploads\/2024\/10\/cropped-favicon.webp","contentUrl":"https:\/\/codesamplez.com\/wp-content\/uploads\/2024\/10\/cropped-favicon.webp","width":512,"height":512,"caption":"codesamplez.com"},"image":{"@id":"https:\/\/codesamplez.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codesamplez","https:\/\/x.com\/codesamplez"]},{"@type":"Person","@id":"https:\/\/codesamplez.com\/#\/schema\/person\/a82c3c07205f4bb73d6b3b0906bc328b","name":"Rana Ahsan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5c7a4f88bcf4a55cd1483386318ebecf27359154275a0b355b0ea186676f9f7f?s=96&d=mm&r=g","caption":"Rana Ahsan"},"description":"Rana Ahsan is a seasoned software engineer and technology leader specialized in distributed systems and software architecture. With a Master\u2019s in Software Engineering from Concordia University, his experience spans leading scalable architecture at Coursera and TopHat, contributing to open-source projects. This blog, CodeSamplez.com, showcases his passion for sharing practical insights on programming and distributed systems concepts and help educate others. Github | X | LinkedIn","sameAs":["https:\/\/github.com\/ranacseruet","https:\/\/www.facebook.com\/ranacseruet","https:\/\/www.linkedin.com\/in\/ranacseruet\/","https:\/\/x.com\/ranacseruet"],"url":"https:\/\/codesamplez.com\/author\/admin"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/codesamplez.com\/wp-content\/uploads\/2011\/04\/wpf-property-grid-c-sharp.webp","jetpack_shortlink":"https:\/\/wp.me\/p1hHlI-bt","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":313,"url":"https:\/\/codesamplez.com\/development\/getting-started-with-wpf-in-c-sharp","url_meta":{"origin":711,"position":0},"title":"Getting Started with WPF in C#: The Ultimate Guide for Beginners","author":"Rana Ahsan","date":"January 30, 2011","format":false,"excerpt":"I've been working with WPF for years now, and trust me, it's absolutely revolutionary compared to the older Windows Forms technology. WPF introduces a completely different approach to UI development that separates design from logic through XAML. This separation is game-changing for developers who want to create modern, responsive applications.","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"Getting Started With C# WPF","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2011\/01\/c-sharp-wpf-for-beginners.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":23060,"url":"https:\/\/codesamplez.com\/development\/wpf-datagrid-c-sharp","url_meta":{"origin":711,"position":1},"title":"WPF DataGrid in C#: The Ultimate Guide for Beginners","author":"Rana Ahsan","date":"February 25, 2013","format":false,"excerpt":"The WPF DataGrid is an incredibly powerful control that offers tremendous flexibility for displaying and manipulating tabular data. Unlike its Windows Forms counterpart, it allows you to embed custom controls within cells, create advanced styling, and implement complex interactions\u2014all while maintaining clean separation between your UI and business logic.RetryClaude can\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"WPF DataGrid C# Tutorial","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/WPF-DataGrid-C-Sharp.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/WPF-DataGrid-C-Sharp.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/WPF-DataGrid-C-Sharp.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/WPF-DataGrid-C-Sharp.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/WPF-DataGrid-C-Sharp.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/02\/WPF-DataGrid-C-Sharp.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":22728,"url":"https:\/\/codesamplez.com\/development\/wpf-hotkeys-c-sharp","url_meta":{"origin":711,"position":2},"title":"WPF HotKeys: Guide to Keyboard Shortcuts in WPF Applications","author":"Rana Ahsan","date":"January 17, 2013","format":false,"excerpt":"Learn how to wire up keyboard events and craft Alt-based hotkey combos in WPF with KeyGesture, RoutedCommand, and CommandBinding\u200b. The tutorial walks through both XAML and C# approaches, filters input via KeyEventArgs, fires MessageBox alerts for Alt + A\/B, and also clarifies modifier keys, handler reuse for mouse clicks, and\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"WPF HotKeys C#","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2013\/01\/wpf-hotkeys-c-sharp.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":81,"url":"https:\/\/codesamplez.com\/development\/c-sharp-desktop-application","url_meta":{"origin":711,"position":3},"title":"C# Desktop Application With Database: A Step-by-Step Guide","author":"Rana Ahsan","date":"November 3, 2010","format":false,"excerpt":"Learn how to build a simple C# desktop application with SQL Server integration using Visual Studio. This step-by-step guide covers creating a Windows Forms project, connecting to a database, and implementing basic CRUD operations\u2014all with minimal coding. Ideal for beginners seeking practical experience in data-driven application development.\u200b","rel":"","context":"In &quot;Database&quot;","block_context":{"text":"Database","link":"https:\/\/codesamplez.com\/category\/database"},"img":{"alt_text":"C# Desktop Application With Database Integration","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-desktop-application.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":187,"url":"https:\/\/codesamplez.com\/development\/application-settings-c-sharp","url_meta":{"origin":711,"position":4},"title":"App Config File in C#: Simplify Your Application Settings","author":"Rana Ahsan","date":"December 18, 2010","format":false,"excerpt":"This article provides a practical guide on managing application settings in C#.NET using configuration files. It explains how to store and retrieve single-value settings via the section and handle multiple-value settings through custom configuration sections. By leveraging the ConfigurationManager class and defining custom configuration classes, developers can externalize dynamic values\u2026","rel":"","context":"In &quot;Development&quot;","block_context":{"text":"Development","link":"https:\/\/codesamplez.com\/category\/development"},"img":{"alt_text":"App Config File in C# Application","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/12\/app-config-c-sharp.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":99,"url":"https:\/\/codesamplez.com\/programming\/drive-info-csharp","url_meta":{"origin":711,"position":5},"title":"C# DriveInfo Class: Access Drive Information Like a Pro","author":"Rana Ahsan","date":"November 10, 2010","format":false,"excerpt":"In this beginner-friendly guide, we explore the C# DriveInfo class to enumerate drives, check formats and free space, and handle removable media effortlessly. Through clear code snippets and practical tips, you\u2019ll learn to build robust disk-inspection tools without WMI. Perfect for .NET 6+ developers diving into system I\/O.","rel":"","context":"In &quot;Programming&quot;","block_context":{"text":"Programming","link":"https:\/\/codesamplez.com\/category\/programming"},"img":{"alt_text":"C# DriveInfo","src":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-drive-info.webp?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-drive-info.webp?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-drive-info.webp?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-drive-info.webp?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-drive-info.webp?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/codesamplez.com\/wp-content\/uploads\/2010\/11\/c-sharp-drive-info.webp?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/posts\/711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/comments?post=711"}],"version-history":[{"count":3,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/posts\/711\/revisions"}],"predecessor-version":[{"id":58478,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/posts\/711\/revisions\/58478"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/media\/58477"}],"wp:attachment":[{"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/media?parent=711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/categories?post=711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codesamplez.com\/wp-json\/wp\/v2\/tags?post=711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}