您好。
经过确认,这个需要处理第一个C1GridView的排序事件,让第二个C1GridView通过代码排序。
这样,才能在控件中执行同步。
同步的代码参考:
- protected void C1GridView1_Sorting(object sender, C1.Web.Wijmo.Controls.C1GridView.C1GridViewSortEventArgs e)
- {
- string ColumnName = e.SortExpression;
- int ColumnIndex = GetColumnIndexByDBName(sender as C1GridView, ColumnName);
- for (int c = 0; c < C1GridView2.Columns.Count; c++)
- {
- if (c == ColumnIndex)
- {
- C1.Web.Wijmo.Controls.C1GridView.C1BoundField SortColumn = (C1BoundField)C1GridView2.Columns[c];
- SortColumn.SortExpression = e.SortExpression;
- SortColumn.SortDirection = e.SortDirection;
- }
- else
- {
- C1.Web.Wijmo.Controls.C1GridView.C1BoundField SortColumn = (C1BoundField)C1GridView2.Columns[c];
- SortColumn.SortExpression = "";
- SortColumn.SortDirection = C1SortDirection.None;
- }
- }
- }
复制代码 |