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 6822853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:42:46+00:00 2026-05-26T21:42:46+00:00

We display our data on datagrids, bound to a dataset, which is in turn

  • 0

We display our data on datagrids, bound to a dataset, which is in turn fed from a Progress database on the server. During processing, we need to make a change to the data-set and refresh it’s value from the server. So far, all well and good and no problems.

The problem is that when we come back with the new data, we want the selection in the datagrid to remain on the same row it was on before. We’ve managed this with the following code:

int iPostingPos = dgridPostings.CurrentRow.Index;

// process data on server
dataContTranMatch.RunBoProcedure(dataContTranMatch.BoProcedure, 
transactionMatchingDataSet);
// Reload Data
LoadData();

if (iPostingPos > ttPOSTingsRowBindingSource.Count)
{
    iPostingPos = ttPOSTingsRowBindingSource.Count;
}
if (ttPOSTingsRowBindingSource.Count > 0)
{
    ttPOSTingsRowBindingSource.Position = iPostingPos;
    dgridPostings.Rows[iPostingPos].Selected = true;
}

This works, but we get the selected line jumping about on the screen, which is really annoying the users.

For example, if you select row 7, then run this code, you have row 7 selected, selection then jumps to row 0, then jumps back to row 7. This isn’t acceptable.

In an attempt to fix this, we’ve tried enclosing the above code in the following additional lines:

chTableLayoutPanel1.SuspendLayout();

*DO CODE*

chTableLayoutPanel1.ResumeLayout();

But this didn’t help.

So far, the most acceptable solution that we’ve been able to reach is to change the colour on the selection so that you can’t see it, letting it leap about and then putting the colours back as they should be. This makes the flicker more acceptable.

dgridPostings.RowsDefaultCellStyle.SelectionBackColor = 
SystemColors.Window;
dgridPostings.RowsDefaultCellStyle.SelectionForeColor = 
SystemColors.ControlText;

DO CODE

dgridPostings.RowsDefaultCellStyle.SelectionBackColor = 
SystemColors.Highlight;
dgridPostings.RowsDefaultCellStyle.SelectionForeColor = 
SystemColors.HighlightText;

We beleive that the issue is caused by the binding source being temporarily empty as the dataset is refreshed, we then re-navigate one it’s got data in it again.

Can anyone offer any ideas on how we can prevent this unpleasent flicker from occuring?

Many thanks

Colin

  • 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-05-26T21:42:46+00:00Added an answer on May 26, 2026 at 9:42 pm

    It may be a bit heavy handed but one option would be to suspend painting of the control. A user asked how to achieve this here: How Do I Suspend Painting For a Control and Its’ Children. I’ve used the selected answer there to achieve something similar.

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

Sidebar

Related Questions

I have an Excel spreadsheet that needs to display data from our SQL database.
On one of our Java application screens, we want to display data loaded from
I'd like to display records from our database in a listview - but retrieves
I want to display some data which comes from my db using jQuery.ajax() (i.e.
I've been asked to display the 'correct' time on our website which I frankly
I am trying to display my events from a MySQL database. I'm using the
We use the Display Tag Library to display grid data in our JSP's. We
We are using AJAX to send data to our database. I've added some feedback
I'm in a satellite office that needs to pull some data from our main
I need to display some data(some text message) from a URL* (an HTML file)

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.