(I learned most of what I'm doing from watching what StrataFrame creates in the form designer when I enter columns manually, etc.)
Any ideas where I might be going wrong?
public virtual void FillRows(MicroFour.StrataFrame.Business.BusinessLayer bo, string dataRetrievalMethodToExecute){// set initial propertiesbase.SuspendLayout();base.ListPopulating += new MicroFour.StrataFrame.UI.Windows.Forms.ListView.ListPopulatingEventHandler(OnListPopulating);base.RowPopulating += new MicroFour.StrataFrame.UI.Windows.Forms.ListView.RowPopulatingEventHandler(OnRowPopulating);base.AutoColumnSort = true;base.AutoNavigateToSelectedRecord = true;base.FullRowSelect = true;base.GridLines = true;base.View = View.Details;// set up the business objectbase.BusinessObject = bo;// set up columns automaticallyMicroFour.StrataFrame.UI.ListViewPopulationColumn OHRLVPopCol;int i = 0;string[] displayFields = bo.AllFieldsList.ToArray();foreach (string field in displayFields){base.Columns.Add(new ColumnHeader());OHRLVPopCol = new MicroFour.StrataFrame.UI.ListViewPopulationColumn();OHRLVPopCol.FormatString = "{" + i++ + "}";OHRLVPopCol.PopulationType = MicroFour.StrataFrame.UI.ListViewColumnPopulationType.FormattedString;OHRLVPopSettings.FormatColumns.Add(OHRLVPopCol);}OHRLVPopSettings.DisplayFieldNames.AddRange(displayFields);OHRLVPopSettings.BusinessObjectType = bo.GetType().ToString();OHRLVPopSettings.DropDownFormatString = "";OHRLVPopSettings.FormatString = "{0}";OHRLVPopSettings.MethodToExecute = dataRetrievalMethodToExecute + ";";OHRLVPopSettings.ValueMember = bo.PrimaryKeyField;base.PopulationDataSourceSettings = OHRLVPopSettings;// fill the list view with x number of records base.Requery();base.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);base.ResumeLayout();// select the first element in the list viewif (Items.Count > 0)Items[0].Selected = true;}
{
MicroFour.StrataFrame.UI.
OHRLVPopCol =
OHRLVPopCol.FormatString =
OHRLVPopCol.PopulationType = MicroFour.StrataFrame.UI.
OHRLVPopSettings.FormatColumns.Add(OHRLVPopCol);
}
OHRLVPopSettings.DisplayFieldNames.AddRange(displayFields);
OHRLVPopSettings.BusinessObjectType = bo.GetType().ToString();
OHRLVPopSettings.DropDownFormatString =
OHRLVPopSettings.FormatString =
OHRLVPopSettings.MethodToExecute = dataRetrievalMethodToExecute +
OHRLVPopSettings.ValueMember = bo.PrimaryKeyField;
Items[0].Selected =
base.Columns.Add(new ColumnHeader());
base.Columns.Insert(i, displayFields[i]);