bGrid::Init() local loCol, lcDeleteCol set classlib to projectmgr additive for each loCol in this.Columns with loCol .Alignment = 4 .Header1.Caption = proper( substr( .Header1.Caption, 2 ) ) .Width = .Width * 0.85 endwith do case case ( "iid" $ lower( loCol.ControlSource ) ) * get rid of this column later lcDeleteCol = loCol.Name case ( "mnotes" $ lower( loCol.ControlSource ) ) * make it an editbox with loCol .RemoveObject( "text1" ) .AddObject( "edit1", "beditbox" ) with .Edit1 .Visible = .t. .SpecialEffect = 1 .ReadOnly = .t. endwith .Sparse = .f. .Width = 200 endwith otherwise endcase endfor with this .RemoveObject( lcDeleteCol ) endwithAnd if you are going to go through and delete columns you can work backwards through the collection and just delete as you go.
for i = this.ColumnCount to 1 step -1 if ( ( i % 2 ) = 0 ) lcName = this.Columns[i].Name this.RemoveObject( lcName ) endif endfor>Hi David. I am not sure what you mean. Do mean that I should invoke the grid builder? If not, the how do I know the name of the objects in the grid, since at design time there are none?