Sure 6.3 is old school - but this is an old VS2003 app using CSLA 1.53.
I've got a collection (generic) of CSLA Editable root objects that have four collection members. I set the Browseable attribute False wherever I can, but can't find a way to do that for .IsNew, .IsDeleted, and .BrokenRulesString.
So I need to hide these columns after setting my generic collection as the DataSource. The Master/Detail grid is really awesome and it allows all the editing I need. But I really want to hide these silly looking properties. Actually I don't even need them because after any changes made by the user, the object graph is getting written to a csv file - not persisted back to the database from which it was extracted.
I know I want to do something in my Form's load event to iterate the grid's various views (one for master view of the EROs and one each for the four collections) and itereate each's columns collection looking for matches by caption or FieldName and set the visible property to false for them. But I have scoured tutorials and documentation and left msgs on the DevEx forum and am still unable to find the syntax to do this.
I'm trying
With xgrdDisplayData.
DataSource = mcolWarrants.
Refresh() 'TODO: Figure out what class name to use for the Column dude For Each oCol As DevExpress.XtraGrid.Columns.GridColumn In xgrdDisplayData.Columns If oCol.FieldName = "IsNew" _ OrElse oCol.FieldName = "IsDeleted" _ OrElse oCol.FieldName = "BrokenRuleString" Then oCol.Visible = False End If Next End Withbut, of course, there is no such thing as xgrdDisplayData.Columns (if only it were that easy!!!).
Thanks in advance.
For Each oCol As DevExpress.XtraGrid.Columns.GridColumn In GridView1.Columns
If oCol.FieldName = "IsNew" _
OrElse oCol.FieldName = "IsDeleted" _
OrElse oCol.FieldName = "BrokenRulesString" Then
oCol.Visible = False
End If
Next
Private
Sub GridView1_MasterRowExpanded(ByVal sender As Object, ByVal e As DevExpress.XtraGrid.Views.Grid.CustomMasterRowEventArgs) Handles GridView1.MasterRowExpanded Dim oPatternView As DevExpress.XtraGrid.Views.Grid.GridViewoPatternView = CType(GridView1.GetDetailView(e.RowHandle, _ e.RelationIndex), DevExpress.XtraGrid.Views.Grid.GridView)
For Each oCol As DevExpress.XtraGrid.Columns.GridColumn In _ oPatternView.Columns
If oCol.FieldName = "IsNew" _
OrElse oCol.FieldName = "IsDeleted" _
OrElse oCol.FieldName = "BrokenRulesString" Then
oCol.Visible = False
End If
Next
oPatternView = Nothing
End Sub
Thank you so much! i was trapped in the same problem for 2 days!!
Copyright (c) Marimer LLC