We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Cols.InsertRange Failing

Cols.InsertRange is failing (not inserting a column) when being called from CurrentCellAcceptedChanges and/or CurrentCellActivated. Is this by design? I need to be able to insert column(s) based on what the user enters. Even the following example fails (gridControl1 has 10 rows, 10 cols). private void gridControl1_CurrentCellAcceptedChanges(object sender, System.ComponentModel.CancelEventArgs e) { int intRow = this.gridControl1.CurrentCell.RowIndex; this.gridControl1.Cols.InsertRange(6, 1); this.gridControl1.Refresh(); }

8 Replies

AD Administrator Syncfusion Team May 12, 2004 04:49 PM UTC

Your sample code seems to work OK for me in version 2.0.5.1. Do I need todo something different than just changing some cell and then tabbing or clicking out of teh changed cell to see the problem? WindowsApplication1_8338.zip


GW Greg Wright May 12, 2004 04:52 PM UTC

>Your sample code seems to work OK for me in version 2.0.5.1. Do I need todo something different than just changing some cell and then tabbing or clicking out of teh changed cell to see the problem? > >WindowsApplication1_8338.zip > > I''m using 1.6.1, and it is happening. v2 is still in beta, isn''t it?


AD Administrator Syncfusion Team May 12, 2004 04:54 PM UTC

No, 2.0 has been in release for about 4 weeks now.


GW Greg Wright May 12, 2004 04:57 PM UTC

>No, 2.0 has been in release for about 4 weeks now. Would it be possible to look at 1.6.1 or 1.6.8 for this issue? I can''t afford to switch versions at this time.


GW Greg Wright May 12, 2004 05:02 PM UTC

Sorry, I didn''t answer your question. I''m just changing the value in a cell and tabbing.


AD Administrator Syncfusion Team May 12, 2004 05:07 PM UTC

Do you see the problem in the sample I posted? If you get any syntax error because the project was done with 2.0, just comment out the offending line.


GW Greg Wright May 12, 2004 05:18 PM UTC

>Do you see the problem in the sample I posted? If you get any syntax error because the project was done with 2.0, just comment out the offending line. Yes. It doesn''t add a column, and the ColCount doesn''t change.


AD Administrator Syncfusion Team May 12, 2004 06:57 PM UTC

Try locking the currentcell (requires 1.6.1.8) while you insert the column. this.gridControl1.CurrentCell.Lock(); int intRow = this.gridControl1.CurrentCell.RowIndex; this.gridControl1.Cols.InsertRange(6, 1); this.gridControl1.CurrentCell.Unlock(); this.gridControl1.Refresh();

Loader.
Live Chat Icon For mobile
Up arrow icon