Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个CheckBoxList,其中有很少的项目。我希望这些项目成为GridView. CheckBoxList它应该随着“有人可以帮我解决这个问题吗?”中项目的变化而动态变化。先感谢您。
CheckBoxList
GridView
DataTable dt = new DataTable(); for (int checked_items = 0; checked_items < checkedListBox1.CheckedItems.Count; checked_items++) { dt.Columns.Add(checkedListBox1.CheckedItems[checked_items].ToString()); } dataGridView1.DataSource = dt;