private void addGridRows()
{
// m_ltDTP is a list of group DTPs. Each group DTP could
// be a grouping of 10min DT periods.
DTP pGroupDTP = null, pSubDTP = null;
NodeBase node = nestedGrid.Rows.RootNode;
DTDef pDTDef = swiSite.DTDefinition;
Hashtable htAllDTCategories = pDTDef.getAllDTCategories();
Containers.DTCategory pDTCategory;
DTA[] DTAs = new DTA[4];
string[] sDTAText = new string[4];
nestedGrid.BackColor = SystemColors.Window;
nestedGrid.Style = GridStyle.XP;
nestedGrid.Options |= GridOptions.ShowFocusRectangle;
nestedGrid.Rows.Options |= RowsOptions.Moveable |
RowsOptions.ShowRowHeaders | RowsOptions.ShowIndicators;
nestedGrid.Rows.RowSizing = RowSizing.Free;
//nestedGrid.Columns.Items.Clear();
nestedGrid.Rows.Items.Clear();
for(int n=0;n<4;n++)
sDTAText[n] = \"[NA]\";
for(int n=0;n
{
pGroupDTP = (DTP) m_ltDTP[n];
for(int k=0;k
{
DTAs[k] = (DTA) pGroupDTP.ltDTAs[k];
if(htAllDTCategories.ContainsKey(DTAs[k].DTCategoryID))
{
pDTCategory = (DTCategory) htAllDTCategories[DTAs[k].DTCategoryID];
sDTAText[k] = pDTCategory.sDTCatgoryName;
}
}
string [][] rootText = new string[][] {
new string[]{pGroupDTP.devName,
SWIMiscAux.Functions.realTime(pGroupDTP.st),
Convert.ToString((pGroupDTP.et - pGroupDTP.st)/3600),
pGroupDTP.eventText,
pGroupDTP.note,
pGroupDTP.lostEnergyWS.ToString(),
pGroupDTP.lostEnergyWTGAdj.ToString(),
pGroupDTP.WindGenHrs.ToString(),
sDTAText[0], sDTAText[1],
sDTAText[2], sDTAText[2]}};
AddNestedTo(node, rootText);
for(int m=0;m
{
pSubDTP = (DTP) pGroupDTP.ltChildDTPs[m];
string[][] nodeText = new string[][]
{
new string[]{pSubDTP.devName,
SWIMiscAux.Functions.realTime(pSubDTP.st),
Convert.ToString((pSubDTP.et - pSubDTP.st)/3600),
pSubDTP.eventText,
pSubDTP.note,
pSubDTP.lostEnergyWS.ToString(),
pSubDTP.lostEnergyWTGAdj.ToString(),
pSubDTP.WindGenHrs.ToString(),
DTAs[0].ID.ToString(), DTAs[1].ID.ToString(),
DTAs[2].ID.ToString(), DTAs[3].ID.ToString()}};
AddNestedTo(node, nodeText);
}
}
}