示例#1
0
        /// <summary>
        /// Called as each row in the grid is initialized - we use this to set the appearance of the row
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void groupGridView_InitializeRow(object sender, InitializeRowEventArgs e)
        {
            // Get the application object being displayed
            UltraGridRow  thisRow    = e.Row;
            UltraGridCell objectCell = thisRow.Cells[0];

            // Set the icon to be displayed based on what type of object we are displaying
            // the object being displayed is held as the value for the first (hidden) column in the row
            if (objectCell.Value is AssetGroup)
            {
                AssetGroup displayGroup = objectCell.Value as AssetGroup;
                thisRow.Cells["Domain"].Appearance.Image = displayGroup.DisplayIcon();
            }

            else if (objectCell.Value is Asset)
            {
                Asset  thisComputer = objectCell.Value as Asset;
                Bitmap icon         = thisComputer.DisplayIcon();
                thisRow.Cells["Domain"].Appearance.Image = icon;
            }
        }