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

Changes in ColStyles don't 'take' in Collection Editor?

I've dropped a grid onto a form, and (using the Designer) changed the Column1 CellType from TextBox to Static. The changes worked great. I then decided to try CellType RichText. This turned out to NOT be what I really needed, so I attempted to change the CellType *back* to Static. The change to Static appeared to work in the CollectionEditor, but after I clicked "OK", the CellType always reverted back to RichText whenever I revisted the CollectionEditor. I MUST be missing something silly here. Why is it that my changes in the CollectionEditor are ignored? (I'm also seeing ReadOnly being 'stuck' on True.) Thanks for your help, -Clift

2 Replies

AD Administrator Syncfusion Team October 21, 2003 06:44 PM UTC

I think it is the readonly that is causing the problem. When you set something readonly, that locks all the properties. We will correct this problem in our code but for the time being, I think you will have to do a little trick to unlock the readonly so you can change things. Open up the form on the designer. Then open the code window for the form as well. In the code window, add this line to the designer generated code after the grid is created but before the code setting the grid properties. // // gridControl1 // this.gridControl1.IgnoreReadOnly = true; //add this line... Then go back to the designer and change the ColStyles' ReadOnly property to false, and then immediately save and run the code. After that, I think you should be able to change the other properties like CellType in the designer and get things to 'take'..

CN Clift Norris October 22, 2003 01:31 PM UTC

Clay, Thanks for your speedy reply! Your suggestion worked fine and I got my ColStyle set just the way I wanted it to be. I added the .IgnoreReadOnly=true line, but it needed to be immediately following the line that 'new's the grid. Otherwise the Form designer complained: this.gridControl1 = new Syncfusion.Windows.Forms.Grid.GridControl(); this.gridControl1.IgnoreReadOnly=true; // added ((System.ComponentModel.ISupportInitialize)(this.gridControl1)).BeginInit(); this.SuspendLayout(); // // gridControl1 // // code to initialize the grid... After I got the ReadOnly property returned to False using the Syncfusion designer, I was suprised to see that my .IgnoreReadOnly=true line had been REMOVED by the Form designer! Anyway, I'm a 'happy camper' now. Thanks for all your help! -Clift

Live Chat Icon For mobile
Up arrow icon