void _column_Add(SimpleGridColumn col) { //순서가 바뀌지 않음 col.OnPropertiesChannged += col_OnPropertiesChannged; if (col.Index == -1 || col.Index >= _columns.Count) { col.Index = _columns.Count; _columns.Add(col.Index, col); return; } //새로 드러올 항목이 인덱스가 중복.. 정리 SimpleGridColumn[] cols = _columns.Values.ToArray <SimpleGridColumn>(); _columns[col.Index] = col; for (int idx = col.Index; idx < cols.Length; idx++) { cols[idx].Index = idx + 1; if (_columns.ContainsKey(idx + 1)) { _columns[idx + 1] = cols[idx]; } else { _columns.Add(idx + 1, cols[idx]); } } }
public usrSimpleGrid() { InitializeComponent(); SimpleGridColumn col = new SimpleGridColumn(); _column_Add(col); _grid_Header_View.OnPropertiesChannged += col_OnPropertiesChannged; _gird_View.OnPropertiesChannged += col_OnPropertiesChannged; }
public void Column_Add(SimpleGridColumn col) { _column_Add(col); Refresh(); }