Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
6344 | Aug 8,2003 10:05 PM UTC | Dec 30,2003 07:03 AM UTC | WinForms | 5 |
![]() |
Tags: GridControl |
private void button1_Click(object sender, System.EventArgs e) { this.gridDataBoundGrid1.Binder.InternalColumns.RemoveAt(1); this.gridDataBoundGrid1.Model.ColCount--; this.gridDataBoundGrid1.Refresh(); }
private GridBoundColumn saveCol = null; private void button1_Click(object sender, System.EventArgs e) {//save and delete item 1 saveCol = this.grid.Binder.InternalColumns[1]; this.grid.Binder.InternalColumns.RemoveAt(1); this.grid.Model.ColCount--; this.grid.Refresh(); } private void button2_Click(object sender, System.EventArgs e) {//insert the saved column at item 1 GridBoundColumnsCollection gbcc = this.grid.Binder.InternalColumns; GridBoundColumn[] boundCols = new GridBoundColumn[gbcc.Count + 1]; int insertLocation = 1; int offSet = 0; for(int i = 0; i < gbcc.Count + 1; ++i) { if(i == insertLocation) { boundCols[i] = saveCol; offSet = 1; } else { boundCols[i] = gbcc[i - offSet]; } } gbcc.Clear(); gbcc.AddRange(boundCols); this.grid.Model.ColCount++; this.grid.Refresh(); }
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.