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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:02:05+00:00 2026-05-27T12:02:05+00:00

I have a dynamically templated gridview. It allows editing, deleting, and inserting new data

  • 0

I have a dynamically templated gridview.

It allows editing, deleting, and inserting new data into the table.

I also implement another function that will to allow filtering the gridview.

Currently I can do the filtering very well. However, when entering the editing mode, the gridview is somehow reset to “state before filtered”.

Ex: Gridview orginally has 100 rows. After filtered only 10 rows. Enter editing mode than it will display 100 rows again.

Here is the snippet while my gridview enter the editing mode.

 public void GridView_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GridView.EditIndex = e.NewEditIndex;
        ((TemplateField)GridView.Columns[1]).EditItemTemplate = null;
        GridView.DataBind();
        Session["SelecetedRowIndex"] = e.NewEditIndex;
    }

Any help is appreciated…

  • 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-27T12:02:07+00:00Added an answer on May 27, 2026 at 12:02 pm

    Remove the call to DataBind() in your RowEditing method.

    public void GridView_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GridView.EditIndex = e.NewEditIndex;
        ((TemplateField)GridView.Columns[1]).EditItemTemplate = null;
        Session["SelecetedRowIndex"] = e.NewEditIndex;
    }
    

    By calling DataBind() here you’re reverting the grid to its original data source, thereby losing the filtering you’ve previously applied.

    EDIT

    Have you tried re-applying your filter before your RowEditing method ends?

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

Sidebar

Related Questions

I dynamically create gridview, and in this grid I have template field also field.HeaderTemplate
I have a dynamically created table which in the last <td> there is a
I am looking for a way to edit data and have values dynamically calculated
I'm working on a web page where I have a dynamically generated table where
For my palm pre app I have a dynamically generated list (pulling in data
I have a TemplateField that is dynamically added to a custom GridView. void ITemplate.InstantiateIn(System.Web.UI.Control
Basically, I have a custom templated control with a custom data container class. When
I have this code $(.delete2).click(function() { $('#load2').fadeIn(); } I have dynamically added item via
I have some dynamically created inputs which are not server-side controls. I want to
I have a dynamically created image that I am saving to a stream so

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.