MenuItem menus = new MenuItem();
GridView1.DataSource = menus.GetDataTable();
GridView1.DataBind();
menus.GetDataTable()返回一个DataTable。在上述情况下,我们正在返回的GridView。我需要将数据填充到一个组合框。我怎样才能做到这一点?
menus.GetDataTable() returns a DataTable. In the above case, we are returning to GridView. I need to populate the data into a combo box. How can i do it?
注:假设GetDataTable只返回一个单列的记录
NOTE: Assume GetDataTable only returns records of a single column.
我使用的WinForms
I'm using Winforms
检查的这个帮助你。