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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:16:22+00:00 2026-06-15T04:16:22+00:00

Before I add this codes, I got error about GridView fired event PageIndexChanging which

  • 0

Before I add this codes, I got error about GridView fired event PageIndexChanging which wasn’t handled and same for Sorting. So I add this event codes then I got Compilation error say that, “CS1061: ‘ASP.serveredit_aspx’ does not contain a definition for ‘GridViewServer_PageIndexChanging’ and no extension method ‘GridViewServer_PageIndexChanging’ accepting a first argument of type ‘ASP.serveredit_aspx’ could be found”. However I already have that event code in C# as well. Please Help

Here my GridView property codes,

<asp:GridView ID="GridViewServer" runat="server" AllowPaging="True" AllowSorting="True" OnPageIndexChanging="GridViewServer_PageIndexChanging" OnSorting="GridViewServer_Sorting" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="ServerName" GridLines="None" ShowFooter="True" onrowcancelingedit="GridViewServer_RowCancelingEdit" 
        onrowdeleting="GridViewServer_RowDeleting" onrowediting="GridViewServer_RowEditing" 
        onrowupdating="GridViewServer_RowUpdating">

The C# code behind for this event,

private string ConvertSortDirectionToSql(SortDirection sortDirection)
    {
        string newSortDirection = String.Empty;

        switch (sortDirection)
        {
            case SortDirection.Ascending:
                newSortDirection = "ASC";
                break;

            case SortDirection.Descending:
                newSortDirection = "DESC";
                break;
        }

        return newSortDirection;
    }

    protected void gridViewServer_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridViewServer.PageIndex = e.NewPageIndex;
        GridViewServer.DataBind();
    }

    protected void gridViewServer_Sorting(object sender, GridViewSortEventArgs e)
    {
        DataTable dataTable = GridViewServer.DataSource as DataTable;

        if (dataTable != null)
        {
            DataView dataView = new DataView(dataTable);
            dataView.Sort = e.SortExpression + " " + ConvertSortDirectionToSql(e.SortDirection);

            GridViewServer.DataSource = dataView;
            GridViewServer.DataBind();
        }
    }
  • 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-15T04:16:24+00:00Added an answer on June 15, 2026 at 4:16 am

    I realize the gridViewServer_PageIndexChanging and gridViewServer_Sorting are lower case. I forgot to capitalize it.

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

Sidebar

Related Questions

How to add value to this form.content before rendering class myform(forms.Form): title = forms.CharField(max_length
I've done this hundreds of times before without issue, but today I've got a
I got this problem when I add this following script in my header.php file.
Hy, my problem is this http://jsfiddle.net/VZ2MK/1/ (function(){ var input = $('.test').clone(); $('a.add_input').on('click', function(e){ $(this).before(input);
i get a problem to set the callback function before indexeddb add transaction os
I have a SQL row with type summary NVARCHAR(4000) NULL and before I add
I have a JTable called Cart where user can add products before buying them.
One has txtDateReceived and second has txtVendorPackDate. Before insert will add record I have
Please add an SSH key before provisioning a machine. I am trying to create
I'm using CSS :before and :after to add dotted line visual elements to a

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.