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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:33:14+00:00 2026-05-25T00:33:14+00:00

In a datagridview, I have counters being updated starting from zero via messages being

  • 0

In a datagridview, I have counters being updated starting from zero via messages being sent in and out. These messages have types, so type A would be incremented if a type A message was sent either in or out. I’ve allowed user sorting so the user can see which types of messages are being sent or received the least or most. However, since I’m updating the specific cell in the row of the message, once you sort the rows, a different number would be there and thus, another counters’ value would be changed instead. For example,

I have types A, B, and C.

A has 4 messages
B has 6 messages,
C has 32 messages.

Let’s say Message type C is coming in right now, but the user sorts the columns, and then the order would be

C 32
B 6
A 4.

Since this is the order, my problem is that I’m updating the cell value. So in the datagrid, I’d be updating cell [1, 2]’s value. Which means A would then have a counter of 5, and C would still have a counter of 32, which is not true. I know the message type is C, so is there some way to index the rows so I know exactly which row’s cell value to update rather than updating the cell itself? This leads to a pretty large error and rows do not have names, so I’m not sure how to approach this problem. I’m thinking of using the header cell’s name and setting the header cell of the rows to A, B, C, and whenever type C comes in, I look for which row the headercell ‘C’ is in, then navigate to the column and update the cell number.

Any insight is appreciated. Thank you so much!

.NET 3.5 SP1.
-tf.rz

  • 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-25T00:33:14+00:00Added an answer on May 25, 2026 at 12:33 am

    If your DataGridView is not bound to any DataSource you should do so. That way you can update your the DataGridView’s DataSource and the DataGridView takes care of updating the correct cell(s) for you.

    If your DataGridView is bound to a DataSource you need to update the DataSource instead of the DataGridView directly.

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

Sidebar

Related Questions

I am working with a DataGridView and have a column of type DataGridViewComboBox and
I have datagridview with paging enabled. But when I want to move from page
I have a datagridview being populated by a collection of objects. the values within
I have a dialog that containers a DataGridView, this dialog is opened from a
hi i have datagridview name data1, and binding data to data1 from database, when
I have datagridview in form1. How can I access datagridview from form2. private void
I have a DataGridView with cells from a database file that contains data. Basically,
Is there a way to make a DataGridView have no cell selected? I notice
Some event handlers for the WinForm DataGridView have DataGridViewCellEventArgs as a parameter and a
I've got some Columns in a DataGridView that have their Binding property set to

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.