示例#1
0
 public SliderCellRenderer(GridControlBase grid, GridCellModelBase cellModel)
     : base(grid, cellModel)
 {
     cm = (SliderCellModel)cellModel;
     SupportsFocusControl = true;
     FixControlParent(drawSlider);
     SetControl(editSlider);
     editSlider.AutoSize      = false;
     editSlider.ValueChanged += new EventHandler(trackBar_ValueChanged);
     cm.trackBarControlSize   = drawSlider.Size;
 }
示例#2
0
 protected override void OnDraw(Graphics g, Rectangle clientRectangle, int rowIndex, int colIndex, GridStyleInfo style)
 {
     if (this.ShouldDrawFocused(rowIndex, colIndex))
     {
         style.Control = editSlider;
     }
     else
     {
         style.Control = drawSlider;
         SliderCellModel.InitializeSlider(drawSlider, style);
     }
     base.OnDraw(g, clientRectangle, rowIndex, colIndex, style);
 }
示例#3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                editSlider.ValueChanged -= new EventHandler(trackBar_ValueChanged);
                editSlider.Dispose();
                editSlider = null;
                drawSlider.Dispose();
                drawSlider = null;
                cm         = null;
            }

            base.Dispose(disposing);
        }
示例#4
0
 protected override void InitializeControlText(object controlValue)
 {
     SliderCellModel.InitializeSlider(this.editSlider, controlValue);
 }
示例#5
0
 protected override void OnInitialize(int rowIndex, int colIndex)
 {
     SliderCellModel.InitializeSlider(editSlider, Grid.GetViewStyleInfo(rowIndex, colIndex));
 }