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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:15:49+00:00 2026-06-04T16:15:49+00:00

In my paginated GridView (contained in an UpdatePanel) bound to ObjectDataSource, I have an

  • 0

In my paginated GridView (contained in an UpdatePanel) bound to ObjectDataSource, I have an OnDataBound event,

protected void GridView1_DataBound(object sender, EventArgs e)
{
    foreach (GridViewRow row in GridView1.Rows)
    {
        // row isn't starting from the first row of current page in mono!
    }
}

When running in .NET, I GridView.Rows always give me the ones in the current page (i.e. GridViewRow.DataItemIndex will not be 0 but its correct index into its data source). But on Mono 2.10.8, this gives me 0 regardless of which page I’m viewing!

However, GridView.Rows[0].DataItem returns the same item as .NET. It would appear that there’s a bug in DataItemIndex.

Is there a way to workaround it and achieve the same behavior as .NET on Mono and still maintain compatibility with .NET?

  • 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-04T16:15:51+00:00Added an answer on June 4, 2026 at 4:15 pm

    Found a way to achieve this.

    public static int GetDataItemIndex(this GridViewRow row)
    {
        var gridView = (GridView)row.NamingContainer;
        return row.RowIndex + (gridView.PageIndex * gridView.PageSize);
    }
    

    This works in both Mono and .NET.

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

Sidebar

Related Questions

I have a DIV that contains paginated results of a MySQL query. I was
I have a method that does a paginated find call like.. 1 coll =
I have a webpage with a report that is paginated while displaying on the
I have an application using a MySql database which is displaying a paginated list
I'm implementing an epub reader in iOS platform. I have paginated the HTML files
I have a DevExpress GridView whose cells are painted with a random color based
How do I convert Resultset object to a paginated view on a JSP? For
I have a YUI Datatable which is paginated. The height the datatable is able
I have a simple image gallery that I've paginated, and I want to to
I have a page the displays messages grouped by date, and paginated via AJAX.

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.