开发者

Is it possible to bind datatable to the ToolStripMenuItem?

I'm using ContextMenuStrip & i created the submenus under ContextMenuStrip at runtime. By adding object of ToolStripMenuItem class.开发者_StackOverflow I'm having one datatable from that table i want to populate my submenus by using id & name field from my datatable for my further processing of application.

Is it possible?

thanks.


Try something like this:

foreach (DataRow dr in dataTable.Rows) {
                cms.Items.Add(new ToolStripMenuItem() {
                    Text = dr["Name"].ToString()
                });
            }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜