private void showSelectedPallete_Click(object sender, EventArgs e) { if (setList.Items.Count <= 0) { return; } mTypesList.Clear(); for (int i = 0; i < setList.Items.Count; i++) { string item = setList.Items[i].ToString(); mTypesList.Add(SimTerrainType.getDefFromDat(item)); } initGridControl(); }