private void RenderDataGridView(AbTagItem[] items) { if (items == null) { items = new AbTagItem[0]; } // 在 DataGridView 显示 DemoUtils.DataGridSpecifyRowCount(dataGridView1, items.Length); for (int i = 0; i < items.Length; i++) { dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString( ); dataGridView1.Rows[i].Cells[1].Value = treeView1.ImageList.Images[GetIamgeKeyByTag(items[i])]; dataGridView1.Rows[i].Cells[2].Value = items[i].Name; dataGridView1.Rows[i].Cells[3].Value = items[i].SymbolType.ToString("X"); dataGridView1.Rows[i].Cells[4].Value = items[i].GetTypeText( ); if (items[i].Tag != null) { dataGridView1.Rows[i].Cells[5].Value = items[i].Tag.ToString( ); } else { dataGridView1.Rows[i].Cells[5].Value = ""; } } }