Click here to Skip to main content
16,013,322 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to set a value in a filter for RadGrid

C#
protected void gvAnalysisView_OnPreRender(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(Request.QueryString["SubjectId"]))
                {

                    gvAnalysisView.MasterTableView.IsFilterItemExpanded = true;
                    gvAnalysisView.MasterTableView.FilterExpression = "([SubjectId] = " + subjectId + ")";
                    GridColumn column = gvAnalysisView.MasterTableView.GetColumnSafe("SubjectId");
                    column.CurrentFilterFunction = GridKnownFunction.EqualTo;
                    column.CurrentFilterValue = subjectId;
                    gvAnalysisView.MasterTableView.Rebind();
                }
            }
        }



this Subject Id values changes as per the client selects the subject.
now the thing is i successfully get the output that the filtered grid with the subjectId value.

But the problem is when i clear the value in the filter then the normal gridview that is gridview with no filter has to be obtained.But when i clear the value it is showing nothing?

and i also want to set the width of the gridview from here?


can anyone help me?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900