Columns Moving in GridView 2025v2 399

Posted by: enrique.pv-ext on 5 May 2026, 3:51 am EST

    • Post Options:
    • Link

    Posted 5 May 2026, 3:51 am EST - Updated 5 May 2026, 4:02 am EST

    Hi,

    Migrate from 2010v1 to 2025v2 399 in ASP.NET WebForms NET Framework 4.8.1.

    Using C1GridView from C1.Web.Wijmo.Controls.48.dll

    Dont exists event OnGroupColumnMoved

    GroupAreaVisible property does not exists.

    My markup OLD code:

    OnGroupColumnMoved="C1GridView1_GroupColumnMoved"

    Not exists OnGroupColumnMoved

    Legacy spaguetti code 2010v1 version:

        protected void C1GridView1_GroupColumnMoved(object sender, C1GridViewColumnMoveEventArgs e)
        {
      if (C1GridView1.GroupedColumns.Count == 0)
      {
          #region Without grouping fields
    
          //Save old filters 
          Object[] b = new Object[C1GridView1.Columns.Count];
          C1BaseFieldCollection col = C1GridView1.Columns;
          col.CopyTo(b, 0);
    
          //Reconfigure grid structure
          C1GridView1.Columns.Clear();
          ConfigureGridViewColumns(int.Parse(Session["reportID"].ToString()));
    
          //Apply filters
          for (int i = 0; i < C1GridView1.Columns.Count; i++)
          {
              for (int j = 0; j < b.Length; j++)
              {
                  if (C1GridView1.Columns[i].GetType() == typeof(C1BoundField))
                  {
                      if (((C1BoundField)C1GridView1.Columns[i]).DataField == ((C1BoundField)b[j]).DataField)
                      {
                          ((C1BoundField)C1GridView1.Columns[i]).FilterValue = ((C1BoundField)b[j]).FilterValue;
                          break;
                      }
                  }
              }
          }
    
          //Get datasource of grid
          C1GridView1.DataSource = Web.Util.GetGridFilterByFieldType(C1GridView1, _dataSources.Tables[0], GetConfigurationParameter(ConfigurationParamType.DefaultDatetimeFormatString), null);
          C1GridView1.DataBind();
          #endregion
      }
      else
      {
          #region Add or change grouping field
          //Grouping field
          C1BoundField fieldGroupBy = (C1BoundField)(((C1.Web.Wijmo.Controls.C1GridView.C1GridViewColumnMovedEventArgs)(e)).Column);
    
          if (C1GridView1.GroupedColumns.Count > 1)
          {
              //If there are two grouping fields, then delete and add only last grouping field selected
              C1GridView1.GroupedColumns.Clear();
              C1GridView1.GroupedColumns.Add(fieldGroupBy);
          }
    
          //Apply order by grouping field
          C1.Web.Wijmo.Controls.C1GridView.C1GridViewSortEventArgs s = new C1GridViewSortEventArgs(((C1BoundField)fieldGroupBy).SortExpression, ((C1BoundField)fieldGroupBy).SortDirection);
          C1GridView1.DataBind();
          C1GridView1_Sorting(C1GridView1, s);
          #endregion
      }

    New events in 2025v2:

      OnColumnMoved="C1GridView1_ColumnMoved"
      OnColumnMoving="C1GridView1_ColumnMoving"

    I try add ColumnMoved event:

            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
                //C1GridView1.GroupColumnMoved += new C1GridViewGroupColumnMovedEventHandler(C1GridView1_GroupColumnMoved);
                C1GridView1.ColumnMoved += C1GridView1_ColumnMoved;
                //C1WebReport.ReportError += new C1.C1Report.ReportEventHandler(C1WebReport_ReportError);
            }
    
            private void C1GridView1_ColumnMoved(object sender, C1.Web.Wijmo.Controls.C1GridView.C1GridViewColumnMovedEventArgs e)
            {
                throw new NotImplementedException();
            }

    ColumnMOved event not handled in console?

    any full samples using columns moving and working when I moved column A, then move column B, etc?

    OnColumnMoved and OnColumnMoving events ?

    thanks all!

  • Posted 5 May 2026, 8:07 am EST

    Hi Kiquenet,

    We are working on your query and will get back to you as soon as possible.

    Regards,

    Akshay

  • Posted 6 May 2026, 5:24 am EST

    Hi,

    I tried to add the ColumnMoving and ColumnMoved even and it seems to be working fine on my side. When I drag and drop a column, the ColumnMoving event is called first, and then the ColumnMoved event. To test this, I added the events in both the Component tag in Default.aspx file and through C# code in the Default.aspx.cs file.

    Please refer to the attached sample application.

    C1WebForms_GridView.zip

  • Posted 6 May 2026, 5:50 am EST - Updated 6 May 2026, 5:59 am EST

    I try sample application.

    CAtegory is the latest column (values 1, 1, 2, 2…)

    Now, I move Category Column, but data column are bad for Category (now has values 18, 19, 10… the prive values) and for price (1,00, 1,00, 2,00,… the category values but using money format) !!!

    Move column, but data dont move !!

    any suggestions please !!!

    moving bad???

  • Posted 7 May 2026, 1:51 am EST

    Hi,

    Please call the BindGrid function again to ensure the data for the columns is recalculated on column move.

    C1WebForms_GridView.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels