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

  • SEARCH
  • Home
  • 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 8203399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:32:31+00:00 2026-06-07T07:32:31+00:00

This is my first question on stackoverflow, so please bear with me if I

  • 0

This is my first question on stackoverflow, so please bear with me if I made any mistakes.

Background:
I have a Winform PropertyGrid that displays status such as gain and exposure from a Camera object. User can control/edit camera properties easily through PropertyGrid. Meanwhile, camera object periodically queries latest status from a physical camera and cause a refresh in PropertyGrid through INotifyProperfyChanged.

Problem:
If a refresh took place while user was entering/editing data on propertygrid (such as entering a new shutter time value), focus was suddenly lost and entered value would be replaced by new value from camera. This resulted in a unfriendly UI experience.

Question:
How to prevent PropertyGrid from performing refresh when user was doing editing?

Thanks in advance.

  • 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-07T07:32:32+00:00Added an answer on June 7, 2026 at 7:32 am

    Edit (1:54 PM CST): The code you want is this, as you would wrap your update code / method call to do the update within it:

    if(FindFocusedControl(this).GetType().ToString() != "GridViewEdit")
    {
    
    }
    

    This will check if the active control,in this case a cell within the propertygrid, is active and skip over the nested code if true.


    Utilizing the following method from this SO question and answer you should be able to wrap whatever code does the updating in an If conditional to check to see what control is being focused/used. If the control in use is the propertygrid, don’t do anything.

        public static Control FindFocusedControl(Control control)
        {
            var container = control as ContainerControl;
            while (container != null)
            {
                control = container.ActiveControl;
                container = control as ContainerControl;
            }
            return control;
    
        }
    

    If you wish to try it, pass it your form and check out the results:

    var a = FindFocusedControl(this);
    

    As you are a new user, if this works out for you, you may accept an answer by clicking on the check mark to the left of a provided answer. This lets other users know what worked for you when they come upon your question later.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my very first question on Stackoverflow, so please bear with me if
This is my first question asked here at stackoverflow, so bear with me please
Greetings everyone. This is my first question here at stackoverflow so please bear with
This is my first post on stackoverflow, so please excuse me if my question
This is the first time I am posting a question on stackoverflow, so please
this is my first question at stackoverflow, so bear with me. In my local
This is my first post on StackOverflow, so please be gentle... I have some
This is my first question on StackOverflow, can you please explain to me what
This is my first question on stackoverflow so I'll try to keep it concise
This is my first question on stackoverflow. I just wonder why my getJSON code

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.