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

The Archive Base Latest Questions

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

I have a gridview that is filtered with a dropdown box. The gridview has

  • 0

I have a gridview that is filtered with a dropdown box. The gridview has LinkButtons that call a ModalPopUpExtender to display data. Once the gridview is filtered and a LinkButton is clicked the GridView filtered results change and the data is incorrect.

<asp:DropDownList ID="ddl_temp" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="ddl_temp_SelectedIndexChanged">
                    <asp:ListItem>Select Status</asp:ListItem>
                    <asp:ListItem>Open</asp:ListItem>
                    <asp:ListItem>Closed</asp:ListItem>
                </asp:DropDownList>
protected void tabs()
{
....
sds.FilterParameters.Clear();
        sds.SelectParameters.Clear();
        ControlParameter cp = new ControlParameter();
            cp.ControlID = ddl_temp.ID.ToString();
            cp.PropertyName = "SelectedValue";
            cp.Name = "Status";
            cp.Type = TypeCode.String;
            cp.ConvertEmptyStringToNull = false;
            sds.FilterParameters.Add(cp);           
            sds.ID = "sds1";
            sds.SelectParameters.Add("sid", sid);
            IssuesPanel.Controls.Add(sds);

        BoundField date = new BoundField();
            date.HeaderText = "Date";
            date.DataField = dt.Columns[2].ToString();
            date.SortExpression = dt.Columns[2].ToString();

        BoundColumn bc = new BoundColumn();
        bc.DataField = dt.Columns[2].ToString();

        BoundField status = new BoundField();
            status.HeaderText = "Status";
            status.DataField = dt.Columns[3].ToString();

         gv4 = new GridView();
            gv4.DataSource = sds;
            gv4.RowDataBound += gv4_RowCommand;
            gv4.Columns.Add(date);
            gv4.Columns.Add(status);
            gv4.CellPadding = 6;
            gv4.AutoGenerateColumns = false;
            //gv4.AllowSorting = true;
            gv4.AllowPaging = true;
            gv4.DataBind();             
        IssuesPanel.Controls.Add(gv4);
...
}



protected void gv4_RowCommand(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            LinkButton lb = new LinkButton();
            lb.Text = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Title"));
            lb.ID = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "Issue_ID"));
            lb.Click += new EventHandler(issueModal);
            e.Row.Cells[0].Controls.Add(lb);

        }

    }

protected void ddl_temp_SelectedIndexChanged(object sender, EventArgs e)
    {


            sds.FilterParameters.Clear();
            ControlParameter cp = new ControlParameter();
            cp.ControlID = ddl_temp.ID.ToString();
            cp.PropertyName = "SelectedValue";
            cp.Name = "Status";
            cp.Type = TypeCode.String;
            cp.ConvertEmptyStringToNull = false;
            sds.FilterParameters.Add(cp);
            sds.FilterExpression = "Status='{0}'";
                gv4.DataSource = sds;
                gv4.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-05-25T00:59:38+00:00Added an answer on May 25, 2026 at 12:59 am

    The way I solved this issue was by saving the FilterExpression in a session variable and assigning it on page_load since every time I clicked a LinkButton it reloaded the page.

    Thanks for your help.

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

Sidebar

Related Questions

I have GridView that allows select. It takes data from EntityDataSource . How do
I have a Gridview that has a timestamp as one of the rows. When
I have a GridView that shows a list of users. Each user has a
I have a GridView that gets it's data from the SQL database . I
I have a gridview that has its DataSourceID property set to a custom ObjectDataSource
I have a gridview that has a column that currently returns a 1 if
I have a gridview that I wish to display gridlines only on certain rows.
I have a GridView that has multiple columns. Let's say I have a business
I currently have a gridview that has an asp:ButtonField as one of the columns.
I have a gridview that I am populating with data for the folks 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.