void grid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { switch (grid.Columns[e.ColumnIndex].Name) { case "Icon": if (e.Value is int) { if (BaseDat.O2Int32(e.Value) <= 0) { e.Value = global::BOF.Properties.Resources.Folder; } else { e.Value = global::BOF.Properties.Resources.textdoc; } } break; case "Code": if (e.Value is int && BaseDat.O2Int32(e.Value) == 0) { e.Value = ".."; } break; case "FP": CD dat = cardSet[e.RowIndex] as CD; if (dat.ID < 0) { e.Value = PathCard2Tree(dat); } break; } }
void grid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (Grid.Columns[e.ColumnIndex].Name == "Icon") { if ((e.Value is int) && (BaseDat.O2Int32(e.Value) < 0)) { e.Value = global::BOF.Properties.Resources.Folder; } else if ((e.Value is int) && (BaseDat.O2Int32(e.Value) == 0)) { e.Value = global::BOF.Properties.Resources.Folder; } else { e.Value = global::BOF.Properties.Resources.document; } } }