Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void cbkCCMReport_OnSelectedIndexChanged(object sender, EventArgs e)
      {
          string category = cbkCCMReport.SelectedValue.ToString();
          Session["category"] = category;
          if (Session["CCMData"] != null)
          {
              DataTable dt = new DataTable();
              dt = (DataTable)Session["CCMData"];
              var filteredTable = (from n in dt.AsEnumerable()
                                   where n.Field<string>("category").Contains("COPD")
                                   select n).CopyToDataTable();

              CCMGridView.DataSource = null;
              CCMGridView.DataSource = filteredTable;
              CCMGridView.DataBind();


          }


}
Posted
Comments
DamithSL 27-Nov-15 0:52am    
debug and check what is the issue when you change the selected item.
sukumar kathula 27-Nov-15 0:55am    
hi thanq for your response.. binding the data into //filtertable as per my requirement ,but in gridview filtered data is not binding.. i tried in all the way..
or else please suggested me is there any other way to filter datatable to linq after clicking on checkbox
DamithSL 27-Nov-15 1:10am    
have you debug and check? in runtime your application should have data in filteredTable.
what are you doing inside page load event? are you check fro ispostback event and load initial data?
sukumar kathula 27-Nov-15 1:18am    
for first time it's loading data.. after check box checked ,it's returning from is post back..
if (IsPostBack) return;

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