protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e) { base.OnColumnWidthChanged(e); if (!string.IsNullOrEmpty(_zxmlname)) { string path = Application.StartupPath + "\\" + _zxmlname; XmlHelperEx.Update(path, "DataGridViewColumns/Column[@cname='" + e.Column.Name + "']", "Width", e.Column.Width.ToString()); } }
void ContextMenu_ColumnVisbleChange(bool cstate, string _cname) { this.Columns[_cname].Visible = cstate; if (!string.IsNullOrEmpty(_zxmlname)) { string path = Application.StartupPath + "\\" + _zxmlname; XmlHelperEx.Update(path, "DataGridViewColumns/Column[@cname='" + _cname + "']/Visble", "", cstate.ToString()); } }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Y <= this.ColumnHeadersHeight) { if (!string.IsNullOrEmpty(_zxmlname)) { string path = Application.StartupPath + "\\" + _zxmlname; foreach (DataGridViewColumn column in this.Columns) { XmlHelperEx.Update(path, "DataGridViewColumns/Column[@cname='" + column.Name + "']/DisplayIndex", "", column.DisplayIndex.ToString()); } } } }
protected override void OnMouseUp(MouseEventArgs e) { // used to keep extra mouse moves from selecting more rows when collapsing base.OnMouseUp(e); this._inExpandCollapseMouseCapture = false; if (e.Y <= this.ColumnHeadersHeight) { if (!string.IsNullOrEmpty(_zxmlname)) { string path = Application.StartupPath + "\\" + _zxmlname; foreach (DataGridViewColumn column in this.Columns) { XmlHelperEx.Update(path, "DataGridViewColumns/Column[@cname='" + column.Name + "']/DisplayIndex", "", column.DisplayIndex.ToString()); } } } }