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; }
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); }
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); }
protected override void InitializeControlText(object controlValue) { SliderCellModel.InitializeSlider(this.editSlider, controlValue); }
protected override void OnInitialize(int rowIndex, int colIndex) { SliderCellModel.InitializeSlider(editSlider, Grid.GetViewStyleInfo(rowIndex, colIndex)); }