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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:57:36+00:00 2026-05-24T15:57:36+00:00

I am using a GridView control to display some data and I need to

  • 0

I am using a GridView control to display some data and I need to programatically change the values of the selected cells. When I iterate through the selected cells collection, it is sorted in the order which you selected the cells in. For example, the row indexes may be 1, 1, 1, 2, 2, 2, 1, 2, 1, 2. I want to edit all the cells with row index 1 before I move on to 2.

  • 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-24T15:57:38+00:00Added an answer on May 24, 2026 at 3:57 pm

    If I understand you correctly, you want to iterate through the SelectedCells collection of a Windows Forms DataGridView in Row Index order.

    I don’t have a real setup to test this right now, but you could try something like this:

    var q = dataGridView1.SelectedCells.OfType<DataGridViewCell>().OrderBy(x => x.RowIndex);
    

    You can then “foreach” over q

    Cheers

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

Sidebar

Related Questions

I am using EntityDataSource control to display Data in Grid, I want to use
i am using gridview control to display records. i am using System.Collections.Generic List<> as
I've a Gridview control using an ODS(ObjectDataSource) to fetch data. For the best performance
Greetings! I'm creating a User Control that will display data in a GridView control.
Hii, I am using DataView control to bind a gridview. In dataview data is
Hi I need help implementing a logic using Gridview control in c#. I have
Using asp.net 3.5 Gridview control, visual studio 2008. I have played with all the
I am using an ASP.NET GridView control, created dynamically with C# on a SharePoint
I am using the ASP.NET3.5 gridview control in a new project. My problem is
My question is on the ASP.NET GridView control. I am using a CommandField in

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.