C1flexgrid double grid scroll bar linkage

Time:2020-10-19

Use afterscroll event to realize double grid linkage.

private void Grid_AfterScroll(object sender, RangeEventArgs e)
  {
      try
      {
          if (!_Interlocking)
          {
              //He was able to resist his control
              _Interlocking = true;
  
              FlexGridFMS grid = sender as FlexGridFMS;
              grid.Update();
              Point pt = grid.ScrollPosition;
  
              //Horizontal movement
              if (grid.Equals(grdData))
              {
                  grdDataSub.ScrollPosition = new Point(pt.X, grdDataSub.ScrollPosition.Y);
              }
              else if (grid.Equals(grdDataSub))
              {
                  grdData.ScrollPosition = new Point(pt.X, grdData.ScrollPosition.Y);
              }
  
              this.Invalidate();
              this.Update();
  
              _Interlocking = false;
          }
      }
      catch (Exception ex)
      {
          ErrorProc(ex);
      }
  }

 

Recommended Today

nuxt.js Imitating wechat app communication chat | Vue + nuxt chat | imitating wechat interface

Project overview be based on vue.js + nuxt.js +Chat room imitating wechat app interface developed by vuex + webpack + node + vant and other technologiesNuxtchatroom project。 It realizes the functions of card type drag and slide, message / expression sending, picture / video preview, red packet / circle of friends and so on. Technology […]