c# - Is it possible to bind datatable to the ToolStripMenuItem? -


i'm using contextmenustrip & created submenus under contextmenustrip @ runtime. adding object of toolstripmenuitem class. i'm having 1 datatable table want populate submenus using id & name field datatable further processing of application.

is possible?

thanks.

try this:

foreach (datarow dr in datatable.rows) {                 cms.items.add(new toolstripmenuitem() {                     text = dr["name"].tostring()                 });             } 

Comments

Popular posts from this blog

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -

Python __call__ special method practical example -