Hi
This code in the page load and I am not control page postback.
So my problem is, when I filter a columns is ok, but when I filter other columns, my before filter values gone. I miss my before filter values. My question, how can I set again before filter columns values?
I get before filter values via this code, but I can not bind filter value again after postback.
Thank you.
This code in the page load and I am not control page postback.
| ....... |
| RadGrid1.Columns.Clear(); |
| RadGrid1.MasterTableView.Columns.Clear(); |
| RadGrid1.AutoGenerateColumns = false; |
| GridBoundColumn boundColumn; |
| for (int i = 0; i < dt.Columns.Count; i++) |
| { |
| if (Request.QueryString["calc"].ToString().Contains(dt.Columns[i].ColumnName.ToString())) |
| { |
| boundColumn = new GridBoundColumn(); |
| boundColumn.DataField = dt.Columns[i].ColumnName.ToString(); |
| boundColumn.HeaderText = dt.Columns[i].ColumnName.ToString(); |
| boundColumn.Groupable = true; |
| boundColumn.UniqueName = dt.Columns[i].ColumnName.ToString(); |
| string[] sumColums = Request.QueryString["calc"].ToString().Split('-'); |
| for (int a = 0; a < sumColums.Length; a++) |
| { |
| if (sumColums[a].Contains(dt.Columns[i].ColumnName.ToString())) |
| { |
| string[] colFormat = sumColums[a].Split(','); |
| boundColumn.FooterAggregateFormatString = colFormat[1].ToString(); |
| if (colFormat[2].ToString() == "sum") |
| { |
| boundColumn.Aggregate = GridAggregateFunction.Sum; |
| } |
| else if (colFormat[2].ToString() == "count") |
| { |
| boundColumn.Aggregate = GridAggregateFunction.Count; |
| } |
| else if (colFormat[2].ToString() == "avg") |
| { |
| boundColumn.Aggregate = GridAggregateFunction.Avg; |
| } |
| } |
| } |
| RadGrid1.MasterTableView.Columns.Add(boundColumn); |
| } |
| .... |
So my problem is, when I filter a columns is ok, but when I filter other columns, my before filter values gone. I miss my before filter values. My question, how can I set again before filter columns values?
| Hashtable hsFiltering = new Hashtable(); |
| for (int i = 0; i < RadGrid1.Columns.Count; i++) |
| { |
| hsFiltering[RadGrid1.Columns[i].HeaderText] = RadGrid1.Columns[i].CurrentFilterValue; |
| } |
Thank you.