Blog Works with MySQL

by Mark Dockal Jr. 18. October 2011 17:33

Blog is finally working with MySql

 

public class MultiLineTextBoxEditingControl: TextBox, IDataGridViewEditingControl
    {
        protected override void OnTextChanged(EventArgs e)
        {
                base.OnTextChanged(e);
                NotifyDataGridViewOfValueChange();
        }

        protected virtual void NotifyDataGridViewOfValueChange()
        {
            this._valueChanged = true;
            if (this._dataGridView != null)
            {
                this._dataGridView.NotifyCurrentCellDirty(true);
            }
        }
      

        public void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGridViewCellStyle)
        {
            throw new NotImplementedException();
        }

        protected DataGridView _dataGridView; 


        public DataGridView EditingControlDataGridView
        {
            get
            {
                return _dataGridView;
            }
            set
            {
                _dataGridView = value;
            }
        }

        public object EditingControlFormattedValue
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        protected int _rowIndex;
        public int EditingControlRowIndex
        {
            get
            {
                return _rowIndex;
            }
            set
            {
                _rowIndex = value;
            }
        }

        protected bool _valueChanged =false;
        public bool EditingControlValueChanged
        {
            get
            {
                return _valueChanged;
            }
            set
            {
                _valueChanged = value;
            }
        }

        public bool EditingControlWantsInputKey(Keys keyData, bool dataGridViewWantsInputKey)
        {
            bool retval = false;
            switch (keyData & Keys.KeyCode)
            {               
                case Keys.Enter:
                    retval = true;
                    break;               
              
                default:
                    break;
            }
            return retval;
        }

        public Cursor EditingPanelCursor
        {
            get { return Cursors.IBeam; }
        }

        public object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context)
        {
            throw new NotImplementedException();
        }

        public void PrepareEditingControlForEdit(bool selectAll)
        {
            throw new NotImplementedException();
        }

        public bool RepositionEditingControlOnValueChange
        {
            get { return false; }
        }       
    }

Tags:

TextBox

Widget Tag cloud not found.

Sequence contains no elementsX

RecentPosts